mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
Disables the rename button if no name or an identical name has been specified.
Checks for '#' in the case of renaming multiple files. svn path=/trunk/KDE/kdebase/apps/; revision=1177675
This commit is contained in:
parent
c7e8c4af3d
commit
b51083c12b
|
@ -64,6 +64,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
|||
}
|
||||
|
||||
m_lineEdit = new KLineEdit(page);
|
||||
connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
|
||||
|
||||
QString fileName = items[0].url().prettyUrl();
|
||||
QString extension = KMimeType::extractKnownExtension(fileName.toLower());
|
||||
|
@ -129,4 +130,12 @@ void RenameDialog::slotButtonClicked(int button)
|
|||
KDialog::slotButtonClicked(button);
|
||||
}
|
||||
|
||||
void RenameDialog::slotTextChanged(const QString &newName)
|
||||
{
|
||||
bool enable = !newName.isEmpty();
|
||||
enable &= (m_renameOneItem ? (newName != m_newName) : newName.contains('#'));
|
||||
enableButtonOk(enable);
|
||||
}
|
||||
|
||||
|
||||
#include "renamedialog.moc"
|
||||
|
|
|
@ -76,6 +76,9 @@ public:
|
|||
protected slots:
|
||||
virtual void slotButtonClicked(int button);
|
||||
|
||||
private slots:
|
||||
void slotTextChanged(const QString &newName);
|
||||
|
||||
private:
|
||||
bool m_renameOneItem;
|
||||
KLineEdit* m_lineEdit;
|
||||
|
|
Loading…
Reference in a new issue