]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
Essential validity check that fell through the cracks when setSelectionRecursive...
[dolphin.git] / src / dolphinview.cpp
index 2c4efca602b31a6fc5ce7cfa77af3604f6c7d0b5..1300d99378bddc7e9817b221109bdf1748d6dbe0 100644 (file)
@@ -31,7 +31,6 @@
 #include <kactioncollection.h>
 #include <kcolorscheme.h>
 #include <kdirlister.h>
-#include <kfileitemdelegate.h>
 #include <kfilepreviewgenerator.h>
 #include <kiconeffect.h>
 #include <klocale.h>
 #include <ktoggleaction.h>
 #include <kurl.h>
 
-#include "dolphindropcontroller.h"
 #include "dolphinmodel.h"
 #include "dolphincolumnview.h"
 #include "dolphincontroller.h"
+#include "dolphinfileitemdelegate.h"
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphindetailsview.h"
 #include "dolphin_detailsmodesettings.h"
 #include "dolphiniconsview.h"
 #include "dolphinsettings.h"
 #include "dolphin_generalsettings.h"
+#include "draganddrophelper.h"
 #include "folderexpander.h"
 #include "renamedialog.h"
 #include "tooltipmanager.h"
@@ -126,7 +126,7 @@ DolphinView::DolphinView(QWidget* parent,
             this, SLOT(clearHoverInformation()));
 
     connect(m_dirLister, SIGNAL(redirection(KUrl, KUrl)),
-            this, SLOT(slotRedirection(KUrl, KUrl)));
+            this, SIGNAL(redirection(KUrl, KUrl)));
     connect(m_dirLister, SIGNAL(completed()),
             this, SLOT(restoreCurrentItem()));
 
@@ -439,6 +439,7 @@ void DolphinView::reload()
 void DolphinView::refresh()
 {
     const bool oldActivationState = m_active;
+    const int oldZoomLevel = m_controller->zoomLevel();
     m_active = true;
 
     createView();
@@ -446,6 +447,7 @@ void DolphinView::refresh()
     reload();
 
     setActive(oldActivationState);
+    updateZoomLevel(oldZoomLevel);
 }
 
 void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl)
@@ -871,7 +873,7 @@ void DolphinView::dropUrls(const KFileItem& destItem,
                            const KUrl& destPath,
                            QDropEvent* event)
 {
-    DolphinDropController::dropUrls(destItem, destPath, event, this);
+    DragAndDropHelper::dropUrls(destItem, destPath, event, this);
 }
 
 void DolphinView::updateSorting(DolphinView::Sorting sorting)
@@ -1027,13 +1029,6 @@ void DolphinView::slotDeleteFileFinished(KJob* job)
     }
 }
 
-void DolphinView::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
-{
-    if (oldUrl == m_controller->url()) {
-        m_controller->setUrl(newUrl);
-    }
-}
-
 void DolphinView::slotRequestUrlChange(const KUrl& url)
 {
     emit requestUrlChange(url);
@@ -1209,8 +1204,9 @@ void DolphinView::createView()
 
     m_controller->setItemView(view);
 
-    m_fileItemDelegate = new KFileItemDelegate(view);
+    m_fileItemDelegate = new DolphinFileItemDelegate(view);
     m_fileItemDelegate->setShowToolTipWhenElided(false);
+    m_fileItemDelegate->setMinimizedNameColumn(m_mode == DetailsView);
     view->setItemDelegate(m_fileItemDelegate);
 
     view->setModel(m_proxyModel);
@@ -1231,6 +1227,8 @@ void DolphinView::createView()
 
     if (DolphinSettings::instance().generalSettings()->showToolTips()) {
         m_toolTipManager = new ToolTipManager(view, m_proxyModel);
+        connect(m_controller, SIGNAL(hideToolTip()),
+                m_toolTipManager, SLOT(hideTip()));
     }
 
     m_topLayout->insertWidget(1, view);