]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Port Dolphin to Baloo
[dolphin.git] / src / views / dolphinview.cpp
index d0a85b3e26ef125112bcca4a3f903fa07d684769..63b53f2e263b68324e0de4c73370bb5b682c8c59 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "dolphinview.h"
 
-#include <config-nepomuk.h>
+#include <config-baloo.h>
 
 #include <QAbstractItemView>
 #include <QApplication>
@@ -74,8 +74,8 @@
 #include "views/tooltips/tooltipmanager.h"
 #include "zoomlevelinfo.h"
 
-#ifdef HAVE_NEPOMUK
-    #include <Nepomuk2/ResourceManager>
+#ifdef HAVE_BALOO
+    #include <baloo/indexerconfig.h>
 #endif
 
 namespace {
@@ -649,6 +649,8 @@ void DolphinView::renameSelectedItems()
         const int index = m_model->index(items.first());
         m_view->editRole(index, "text");
 
+        hideToolTip();
+
         connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
                 this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
     } else {
@@ -868,14 +870,10 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
     KItemListView* view = m_container->controller()->view();
     const QSet<QByteArray> visibleRolesSet = view->visibleRoles().toSet();
 
-    bool nepomukRunning = false;
     bool indexingEnabled = false;
-#ifdef HAVE_NEPOMUK
-    nepomukRunning = (Nepomuk2::ResourceManager::instance()->initialized());
-    if (nepomukRunning) {
-        KConfig config("nepomukserverrc");
-        indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", true);
-    }
+#ifdef HAVE_BALOO
+    Baloo::IndexerConfig config;
+    indexingEnabled = config.fileIndexingEnabled();
 #endif
 
     QString groupName;
@@ -906,8 +904,8 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
         action->setChecked(visibleRolesSet.contains(info.role));
         action->setData(info.role);
 
-        const bool enable = (!info.requiresNepomuk && !info.requiresIndexer) ||
-                            (info.requiresNepomuk && nepomukRunning) ||
+        const bool enable = (!info.requiresBaloo && !info.requiresIndexer) ||
+                            (info.requiresBaloo) ||
                             (info.requiresIndexer && indexingEnabled);
         action->setEnabled(enable);
     }
@@ -1486,7 +1484,9 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
             }
 
             KonqOperations* op = KonqOperations::renameV2(this, oldUrl, newName);
-            if (op) {
+            if (op && !newNameExistsAlready) {
+                // Only connect the renamingFailed signal if there is no item with the new name
+                // in the model yet, see bug 328262.
                 connect(op, SIGNAL(renamingFailed(KUrl,KUrl)), SLOT(slotRenamingFailed(KUrl,KUrl)));
             }
         }