]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Merge remote-tracking branch 'origin/KDE/4.9'
[dolphin.git] / src / views / dolphinview.cpp
index 0e97c5a2bf40d27421d04e49641e4dc82a9ca1d5..54c0faa8d129662cbe54bd6eb83335496bd7a0d5 100644 (file)
@@ -73,7 +73,7 @@
 #include "zoomlevelinfo.h"
 
 #ifdef HAVE_NEPOMUK
-    #include <Nepomuk/ResourceManager>
+    #include <Nepomuk2/ResourceManager>
 #endif
 
 namespace {
@@ -155,6 +155,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
 
     connect(m_model, SIGNAL(directoryLoadingStarted()),       this, SLOT(slotDirectoryLoadingStarted()));
     connect(m_model, SIGNAL(directoryLoadingCompleted()),     this, SLOT(slotDirectoryLoadingCompleted()));
+    connect(m_model, SIGNAL(directoryLoadingCanceled()),      this, SIGNAL(directoryLoadingCanceled()));
     connect(m_model, SIGNAL(directoryLoadingProgress(int)),   this, SIGNAL(directoryLoadingProgress(int)));
     connect(m_model, SIGNAL(directorySortingProgress(int)),   this, SIGNAL(directorySortingProgress(int)));
     connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
@@ -638,25 +639,25 @@ void DolphinView::clearSelection()
 void DolphinView::renameSelectedItems()
 {
     const KFileItemList items = selectedItems();
-     if (items.isEmpty()) {
-         return;
-     }
-
-     if (items.count() == 1 && GeneralSettings::renameInline()) {
-         const int index = m_model->index(items.first());
-         m_view->editRole(index, "text");
-     } else {
-         RenameDialog* dialog = new RenameDialog(this, items);
-         dialog->setAttribute(Qt::WA_DeleteOnClose);
-         dialog->show();
-         dialog->raise();
-         dialog->activateWindow();
-     }
-
-     // Assure that the current index remains visible when KFileItemModel
-     // will notify the view about changed items (which might result in
-     // a changed sorting).
-     m_assureVisibleCurrentIndex = true;
+    if (items.isEmpty()) {
+        return;
+    }
+
+    if (items.count() == 1 && GeneralSettings::renameInline()) {
+        const int index = m_model->index(items.first());
+        m_view->editRole(index, "text");
+    } else {
+        RenameDialog* dialog = new RenameDialog(this, items);
+        dialog->setAttribute(Qt::WA_DeleteOnClose);
+        dialog->show();
+        dialog->raise();
+        dialog->activateWindow();
+    }
+
+    // Assure that the current index remains visible when KFileItemModel
+    // will notify the view about changed items (which might result in
+    // a changed sorting).
+    m_assureVisibleCurrentIndex = true;
 }
 
 void DolphinView::trashSelectedItems()
@@ -799,6 +800,14 @@ void DolphinView::slotItemsActivated(const QSet<int>& indexes)
         items.append(m_model->fileItem(index));
     }
 
+    if (items.count() > 5) {
+        QString question = QString("Are you sure you want to open %1 items?").arg(items.count());
+        const int answer = KMessageBox::warningYesNo(this, question);
+        if (answer != KMessageBox::Yes) {
+            return;
+        }
+    }
+
     foreach (const KFileItem& item, items) {
         if (item.isDir()) {
             emit tabRequested(item.url());
@@ -839,7 +848,7 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
     bool nepomukRunning = false;
     bool indexingEnabled = false;
 #ifdef HAVE_NEPOMUK
-    nepomukRunning = (Nepomuk::ResourceManager::instance()->initialized());
+    nepomukRunning = (Nepomuk2::ResourceManager::instance()->initialized());
     if (nepomukRunning) {
         KConfig config("nepomukserverrc");
         indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", false);