]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
- Fixed crash when showing "Open With..." items of the context menu: the model index...
[dolphin.git] / src / dolphinview.cpp
index bf92b34f4d617cbb4aa44768b2eab7d4e79ea15a..7d24ebca596598d5e5454a6b83aff6d954782a0c 100644 (file)
@@ -45,7 +45,6 @@
 #include "dolphiniconsview.h"
 #include "dolphincontextmenu.h"
 #include "filterbar.h"
-#include "progressindicator.h"
 #include "renamedialog.h"
 #include "urlnavigator.h"
 #include "viewproperties.h"
@@ -242,11 +241,6 @@ void DolphinView::renameSelectedItems()
             assert(newName.contains('#'));
 
             const int urlsCount = urls.count();
-            ProgressIndicator* progressIndicator =
-                new  ProgressIndicator(mainWindow(),
-                                       i18n("Renaming items..."),
-                                       i18n("Renaming finished."),
-                                       urlsCount);
 
             // iterate through all selected items and rename them...
             const int replaceIndex = newName.indexOf('#');
@@ -262,8 +256,6 @@ void DolphinView::renameSelectedItems()
 
                     const bool destExists = KIO::NetAccess::exists(dest, false, view);
                     if (destExists) {
-                        delete progressIndicator;
-                        progressIndicator = 0;
                         view->statusBar()->setMessage(i18n("Renaming failed (item '%1' already exists).",name),
                                                       DolphinStatusBar::Error);
                         break;
@@ -275,11 +267,7 @@ void DolphinView::renameSelectedItems()
                         //undoMan.addCommand(command);
                     }
                 }
-
-                progressIndicator->execOperation();
             }
-            delete progressIndicator;
-            progressIndicator = 0;
 
             //undoMan.endMacro();
         }
@@ -511,9 +499,10 @@ KUrl::List DolphinView::selectedUrls() const
     return urls;
 }
 
-const KFileItem* DolphinView::currentFileItem() const
+KFileItem* DolphinView::fileItem(const QModelIndex index) const
 {
-    return 0; // fileView()->currentFileItem();
+    const QModelIndex dirModelIndex = m_proxyModel->mapToSource(index);
+    return m_dirModel->itemForIndex(dirModelIndex);
 }
 
 void DolphinView::openContextMenu(KFileItem* fileInfo, const QPoint& pos)