]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / views / dolphinview.cpp
index db917ee5a3e8b16774d4081bf9cc26017d5637bf..681ce74f7fe352f4305ee439069984bb2e2d4106 100644 (file)
@@ -434,12 +434,8 @@ void DolphinView::refresh()
     m_active = true;
 
     createView();
-    reload();
-
-    // For performance reasons applying the view properties should be done after updating
-    // the directory-lister URL with reload(). Otherwise in combination with enabled
-    // previews the creation of already obsolete directory items gets triggered.
     applyViewProperties();
+    reload();
 
     setActive(oldActivationState);
     updateZoomLevel(oldZoomLevel);
@@ -548,6 +544,7 @@ void DolphinView::setUrl(const KUrl& url)
 
     m_viewModeController->setUrl(url); // emits urlChanged, which we forward
     m_viewAccessor.prepareUrlChange(url);
+    applyViewProperties();
 
     // When changing the URL there is no need to keep the version
     // data of the previous URL.
@@ -557,11 +554,6 @@ void DolphinView::setUrl(const KUrl& url)
     connectViewAccessor();
     loadDirectory(url);
 
-    // For performance reasons applying the view properties should be done after updating
-    // the directory-lister URL with loadDirectory(). Otherwise in combination with enabled
-    // previews the creation of already obsolete directory items gets triggered.
-    applyViewProperties();
-
     if (hadSelection || hasSelection()) {
         emitSelectionChangedSignal();
     }
@@ -617,6 +609,10 @@ void DolphinView::renameSelectedItems()
         dialog->raise();
         dialog->activateWindow();
     }
+
+    // assure that the current index remains visible when KDirLister
+    // will notify the view about changed items
+    m_assureVisibleCurrentIndex = true;
 }
 
 void DolphinView::trashSelectedItems()
@@ -692,6 +688,8 @@ void DolphinView::setShowHiddenFiles(bool show)
         return;
     }
 
+    m_selectedItems = selectedItems();
+
     const KUrl viewPropsUrl = rootUrl();
     ViewProperties props(viewPropsUrl);
     props.setShowHiddenFiles(show);
@@ -776,6 +774,14 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
     return QWidget::eventFilter(watched, event);
 }
 
+void DolphinView::showEvent(QShowEvent* event)
+{
+    QWidget::showEvent(event);
+    if (!event->spontaneous()) {
+        loadDirectory(url());
+    }
+}
+
 void DolphinView::activate()
 {
     setActive(true);
@@ -1478,6 +1484,11 @@ void DolphinView::ViewAccessor::createView(QWidget* parent,
     default:
         Q_ASSERT(false);
     }
+
+    KDirLister* lister = dirLister();
+    if (lister) {
+        lister->setMainWindow(parent->window());
+    }
 }
 
 void DolphinView::ViewAccessor::deleteView()