]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that no reloading is done if KDirLister emits a redirection, only change the...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 24 Oct 2008 19:52:28 +0000 (19:52 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 24 Oct 2008 19:52:28 +0000 (19:52 +0000)
BUG: 155591

svn path=/trunk/KDE/kdebase/apps/; revision=875554

src/dolphinview.cpp
src/dolphinview.h
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h

index 9d6038c2c7c9aa4eb68a21656fcb0de4376a3822..9e454ea711f326fdd2276d477057f4c2c6d12292 100644 (file)
@@ -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()));
 
@@ -1027,13 +1027,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);
index 6c67f986b41b5a6dbffedc6747335e265ac020f7..170bc6bf836e9b24e0ca27585132e2f2d78cb580 100644 (file)
@@ -85,7 +85,8 @@ public:
     {
         /**
          * The directory items are shown as icons including an
-         * icon name. */
+         * icon name. 
+         */
         IconsView = 0,
 
         /**
@@ -525,6 +526,12 @@ signals:
      */
     void startedPathLoading(const KUrl& url);
 
+    /**
+     * Emitted when KDirLister emits redirection.
+     * Testcase: fish://localhost
+     */
+    void redirection(const KUrl& oldUrl, const KUrl& newUrl);
+
 protected:
     /** @see QWidget::mouseReleaseEvent */
     virtual void mouseReleaseEvent(QMouseEvent* event);
@@ -607,12 +614,6 @@ private slots:
      */
     void slotDeleteFileFinished(KJob* job);
 
-    /**
-     * Called when KDirLister emits redirection.
-     * Testcase: fish://localhost
-     */
-    void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
-
     /**
      * Is emitted if the controller requests a changing of the current
      * URL to \a url
index bed7d275848eee531f92b4813f5fe3be0bc3cb67..3c1445fa5a07f356eaf89ebbe984dddf8f6ee5d2 100644 (file)
@@ -140,6 +140,8 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
             this, SLOT(slotItemTriggered(KFileItem)));
     connect(m_view, SIGNAL(startedPathLoading(const KUrl&)),
             this, SLOT(saveRootUrl(const KUrl&)));
+    connect(m_view, SIGNAL(redirection(KUrl, KUrl)),
+            this, SLOT(redirect(KUrl, KUrl)));
 
     connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
             this, SLOT(restoreView(const KUrl&)));
@@ -370,6 +372,15 @@ void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event)
     DolphinDropController::dropUrls(KFileItem(), destination, event, this);
 }
 
+void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)
+{
+    Q_UNUSED(oldUrl);
+    const bool block = m_urlNavigator->signalsBlocked();
+    m_urlNavigator->blockSignals(true);
+    m_urlNavigator->setUrl(newUrl);
+    m_urlNavigator->blockSignals(block);
+}
+
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     KUrl url = item.targetUrl();
index 4938835d8e38c23e2dd3142d5b40f68a0135e537..1c6f8a6bcbcb8d436ffe95b17ad836907ca715b3 100644 (file)
@@ -212,6 +212,13 @@ private slots:
      * above the destination \a destination.
      */
     void dropUrls(const KUrl& destination, QDropEvent* event);
+    
+    /**
+     * Is invoked when a redirection is done and changes the
+     * URL of the URL navigator to \a newUrl without triggering
+     * a reloading of the directory.
+     */
+    void redirect(const KUrl& oldUrl, const KUrl& newUrl);
 
 private:
     bool m_showProgress;