┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2009-01-16 13:21:33 +0000
committerDavid Faure <[email protected]>2009-01-16 13:21:33 +0000
commitf56446a61aec0b8aababd4a306bdb2305b282c29 (patch)
tree6e529f5ddba500da4fb2ed8ef12b3a6ab76b66bd /src
parent185f35da3a5d1ef17988bae09f60513147d851ba (diff)
Repair redirections in DolphinPart, it used to notify of redirections by connecting to urlChanged,
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: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=911974
Diffstat (limited to 'src')
-rw-r--r--src/dolphinpart.cpp20
-rw-r--r--src/dolphinpart.h9
2 files changed, 25 insertions, 4 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 05bc2216a..7fd51f76a 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -18,6 +18,7 @@
*/
#include "dolphinpart.h"
+#include <kdebug.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
+ 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.
@@ -414,11 +417,20 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
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)
diff --git a/src/dolphinpart.h b/src/dolphinpart.h
index d1c5b3c7f..04e343d95 100644
--- a/src/dolphinpart.h
+++ b/src/dolphinpart.h
@@ -143,10 +143,19 @@ private Q_SLOTS:
/**
* 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);
/**
+ * 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().
*/