]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Repair redirections in DolphinPart, it used to notify of redirections by connecting...
authorDavid Faure <faure@kde.org>
Fri, 16 Jan 2009 13:21:33 +0000 (13:21 +0000)
committerDavid Faure <faure@kde.org>
Fri, 16 Jan 2009 13:21:33 +0000 (13:21 +0000)
but iirc there were recent changes which make dolphinview emit redirection instead of urlChanged in that case
Makes me wonder if urlChanged is still useful for anything?
CCMAIL: peter.penz@gmx.at

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

src/dolphinpart.cpp
src/dolphinpart.h

index 05bc2216a58d3a806de6532831fdad0d09ac3582..7fd51f76a4b6eb24d83274bf139b2fac9c4ae26f 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "dolphinpart.h"
 */
 
 #include "dolphinpart.h"
+#include <kdebug.h>
 #include "dolphinviewactionhandler.h"
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinview.h"
 #include "dolphinviewactionhandler.h"
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinview.h"
@@ -107,6 +108,8 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
             this, SLOT(slotRequestUrlChange(KUrl)));
     connect(m_view, SIGNAL(modeChanged()),
             this, SIGNAL(viewModeChanged())); // relay signal
             this, SLOT(slotRequestUrlChange(KUrl)));
     connect(m_view, SIGNAL(modeChanged()),
             this, SIGNAL(viewModeChanged())); // relay signal
+    connect(m_view, SIGNAL(redirection(KUrl, KUrl)),
+            this, SLOT(slotRedirection(KUrl, KUrl)));
 
     // Watch for changes that should result in updates to the
     // status bar text.
 
     // Watch for changes that should result in updates to the
     // status bar text.
@@ -414,11 +417,20 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
                                 actionGroups);
 }
 
                                 actionGroups);
 }
 
-void DolphinPart::slotUrlChanged(const KUrl& url)
+// ########### not sure this is still called... seems not.
+void DolphinPart::slotUrlChanged(const KUrl& newUrl)
 {
 {
-    KParts::ReadOnlyPart::setUrl(url);
-    QString prettyUrl = url.pathOrUrl();
-    emit m_extension->setLocationBarUrl(prettyUrl);
+    slotRedirection(url(), newUrl);
+}
+
+void DolphinPart::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
+{
+    //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
+    if (oldUrl == url()) {
+        KParts::ReadOnlyPart::setUrl(newUrl);
+        const QString prettyUrl = newUrl.pathOrUrl();
+        emit m_extension->setLocationBarUrl(prettyUrl);
+    }
 }
 
 void DolphinPart::slotRequestUrlChange(const KUrl& url)
 }
 
 void DolphinPart::slotRequestUrlChange(const KUrl& url)
index d1c5b3c7fe9a76e29b9d36e56ea6f4873dcd4c29..04e343d956ce1fc54ee4657e7df413357ddec340 100644 (file)
@@ -143,9 +143,18 @@ private Q_SLOTS:
 
     /**
      * Informs the host that we are opening \a url (e.g. after a redirection).
 
     /**
      * Informs the host that we are opening \a url (e.g. after a redirection).
+     * ########### not sure this is still called... seems not.
      */
     void slotUrlChanged(const KUrl& url);
 
      */
     void slotUrlChanged(const KUrl& url);
 
+    /**
+     * Informs the host that we are opening \a url (e.g. after a redirection
+     * coming from KDirLister).
+     * Testcase 1: fish://localhost
+     * Testcase 2: showing a directory that is being renamed by another window (#180156)
+     */
+    void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+
     /**
      * Updates the state of the 'Edit' menu actions and emits
      * the signal selectionChanged().
     /**
      * Updates the state of the 'Edit' menu actions and emits
      * the signal selectionChanged().