]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Converted to the standard mimetype names
[dolphin.git] / src / dolphinmainwindow.cpp
index 5183f993d31971e0c895df9343a4ca2549ad0c4c..a2bb16b8ab8f3206b3bc7667788a56bd57b5b318 100644 (file)
@@ -29,7 +29,7 @@
 #include "dolphinsettingsdialog.h"\r
 #include "dolphinstatusbar.h"\r
 #include "infosidebarpage.h"\r
-#include "metadataloader.h"\r
+#include "metadatawidget.h"\r
 #include "mainwindowadaptor.h"\r
 #include "treeviewsidebarpage.h"\r
 #include "urlnavigator.h"\r
@@ -204,6 +204,7 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
 \r
 void DolphinMainWindow::rename(const KUrl& oldUrl, const KUrl& newUrl)\r
 {\r
+    clearStatusBar();\r
     KonqOperations::rename(this, oldUrl, newUrl);\r
     m_undoCommandTypes.append(KonqUndoManager::RENAME);\r
 }\r
@@ -456,17 +457,29 @@ void DolphinMainWindow::deleteItems()
 {\r
     clearStatusBar();\r
 \r
+    // TODO: if KonqOperations::askDeleteConfirmation() would indicate when\r
+    // the operation has been finished, this method should be used.\r
+\r
     KUrl::List list = m_activeView->selectedUrls();\r
     const uint itemCount = list.count();\r
     Q_ASSERT(itemCount >= 1);\r
 \r
     QString text;\r
     if (itemCount > 1) {\r
-        text = i18n("Do you really want to delete the %1 selected items?",itemCount);\r
+        text = i18n("Do you really want to delete the %1 selected items?", itemCount);\r
     }\r
     else {\r
         const KUrl& url = list.first();\r
-        text = i18n("Do you really want to delete '%1'?",url.fileName());\r
+        QString itemName;\r
+        if (url.protocol() == "trash" ) {\r
+            itemName = url.path();\r
+            // TODO: check comment in konq_undo.cc in the method askDeleteConfirmation()\r
+            itemName.remove(QRegExp("^/[0-9]*-"));\r
+        }\r
+        else {\r
+           itemName = url.pathOrUrl();\r
+        }\r
+        text = i18n("Do you really want to delete '%1'?", itemName);\r
     }\r
 \r
     const bool del = KMessageBox::warningContinueCancel(this,\r
@@ -544,7 +557,7 @@ void DolphinMainWindow::slotUndoAvailable(bool available)
                                       DolphinStatusBar::OperationCompleted);\r
                 break;\r
 \r
-           case KonqUndoManager::MKDIR:\r
+            case KonqUndoManager::MKDIR:\r
                 statusBar->setMessage(i18n("Created directory."),\r
                                       DolphinStatusBar::OperationCompleted);\r
                 break;\r
@@ -1045,7 +1058,7 @@ void DolphinMainWindow::init()
         resize(640, 480);\r
     }\r
     #ifdef HAVE_KMETADATA\r
-    if (!DolphinApplication::app()->metadataLoader()->storageUp())\r
+    if ( !MetaDataWidget::metaDataAvailable() )\r
         activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);\r
     #endif\r
 }\r