]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/renamedialog.cpp
Fix race condition and deadlock in the version plugin
[dolphin.git] / src / views / renamedialog.cpp
index e232b9614a075c0a10c868aaf82919d77f2e4a19..a91f91b1b431246ad6e04cfc28c59d6f615bdf82 100644 (file)
@@ -87,7 +87,9 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
     if (m_renameOneItem) {
         const QString fileName = items.first().url().prettyUrl();
         const QString extension = KMimeType::extractKnownExtension(fileName.toLower());
-        if (extension.length() > 0) {
+
+        // If the current item is a directory, select the whole file name.
+        if ((extension.length() > 0) && !items.first().isDir()) {
             // Don't select the extension
             selectionLength -= extension.length() + 1;
         }