]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/treeviewcontextmenu.cpp
No need to call rowCount() all the time.
[dolphin.git] / src / treeviewcontextmenu.cpp
index 0c64677fa952f188a3be1a25bac6547f81725cdf..cdb1afedad8edd01c01fae8f820e8d04c0ffa610 100644 (file)
@@ -145,8 +145,8 @@ void TreeViewContextMenu::rename()
     if (dialog.exec() == QDialog::Accepted) {
         const QString& newName = dialog.newName();
         if (!newName.isEmpty()) {
-            KUrl newUrl = oldUrl.upUrl();
-            newUrl.addPath(newName);
+            KUrl newUrl = oldUrl;
+            newUrl.setFileName(newName);
             KonqOperations::rename(m_parent, oldUrl, newUrl);
         }
     }
@@ -159,14 +159,7 @@ void TreeViewContextMenu::moveToTrash()
 
 void TreeViewContextMenu::deleteItem()
 {
-    const KUrl& url = m_fileInfo->url();
-    const bool del = KonqOperations::askDeleteConfirmation(url,
-                                                           KonqOperations::DEL,
-                                                           KonqOperations::FORCE_CONFIRMATION,
-                                                           m_parent);
-    if (del) {
-        KIO::del(url);
-    }
+    KonqOperations::del(m_parent, KonqOperations::DEL, m_fileInfo->url());
 }
 
 void TreeViewContextMenu::showProperties()