[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdebase/apps/dolphin/src
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2008-10-24 20:32:45
Message-ID: 1224880365.887524.7157.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 875564 by ppenz:

Backport of SVN commit 875554:

Assure that no reloading is done if KDirLister emits a redirection, only change the \
the URL. Thanks to David Faure and Albert Alstals Cid for the detailed analysis!

CCBUG: 155591

 M  +1 -8      dolphinview.cpp  
 M  +6 -6      dolphinview.h  
 M  +11 -1     dolphinviewcontainer.cpp  
 M  +7 -0      dolphinviewcontainer.h  


--- branches/KDE/4.1/kdebase/apps/dolphin/src/dolphinview.cpp #875563:875564
@@ -123,7 +123,7 @@
             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()));
 
@@ -1214,11 +1214,4 @@
     m_controller->setUrl(url);
 }
 
-void DolphinView::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
-{
-    if (oldUrl == m_controller->url()) {
-        m_controller->setUrl(newUrl);
-    }
-}
-
 #include "dolphinview.moc"
--- branches/KDE/4.1/kdebase/apps/dolphin/src/dolphinview.h #875563:875564
@@ -507,6 +507,12 @@
      * Used for feedback in the mainwindow.
      */
     void doingOperation(KIO::FileUndoManager::CommandType type);
+    
+    /**
+     * Emitted when KDirLister emits redirection.
+     * Testcase: fish://localhost
+     */
+    void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
 
 protected:
     /** @see QWidget::mouseReleaseEvent */
@@ -591,12 +597,6 @@
     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
      */
--- branches/KDE/4.1/kdebase/apps/dolphin/src/dolphinviewcontainer.cpp #875563:875564
@@ -138,7 +138,8 @@
             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&)));
 
@@ -405,6 +406,15 @@
     m_urlNavigator->saveRootUrl(m_view->rootUrl());
 }
 
+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();
--- branches/KDE/4.1/kdebase/apps/dolphin/src/dolphinviewcontainer.h #875563:875564
@@ -202,6 +202,13 @@
      */
     void saveRootUrl(const KUrl& url);
 
+    /**
+     * 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:
     /**
      * Returns the default text of the status bar, if no item is


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic