[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/apps/dolphin/src
From: David Faure <faure () kde ! org>
Date: 2008-05-28 23:07:10
Message-ID: 1212016030.508340.10606.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 813954 by dfaure:
Handle redirections (e.g. from fish://localhost) without breaking the column view -- \
thanks Peter for the advice on how to separate the two cleanly.
M +8 -0 dolphinpart.cpp
M +5 -0 dolphinpart.h
M +15 -1 dolphinview.cpp
M +18 -0 dolphinview.h
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinpart.cpp #813953:813954
@@ -100,6 +100,8 @@
this, SLOT(slotRequestItemInfo(KFileItem)));
connect(m_view, SIGNAL(urlChanged(KUrl)),
this, SLOT(slotUrlChanged(KUrl)));
+ connect(m_view, SIGNAL(requestUrlChange(KUrl)),
+ this, SLOT(slotRequestUrlChange(KUrl)));
connect(m_view, SIGNAL(modeChanged()),
this, SIGNAL(viewModeChanged())); // relay signal
@@ -357,6 +359,12 @@
void DolphinPart::slotUrlChanged(const KUrl& url)
{
+ QString prettyUrl = url.pathOrUrl();
+ emit m_extension->setLocationBarUrl(prettyUrl);
+}
+
+void DolphinPart::slotRequestUrlChange(const KUrl& url)
+{
if (m_view->url() != url) {
// If the view URL is not equal to 'url', then an inner URL change has
// been done (e. g. by activating an existing column in the column view).
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinpart.h #813953:813954
@@ -138,6 +138,11 @@
* Asks the host to open the URL \a url if the current view has
* a different URL.
*/
+ void slotRequestUrlChange(const KUrl& url);
+
+ /**
+ * Informs the host that we are opening \a url (e.g. after a redirection).
+ */
void slotUrlChanged(const KUrl& url);
/**
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinview.cpp #813953:813954
@@ -102,7 +102,7 @@
connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
this, SIGNAL(urlChanged(const KUrl&)));
connect(m_controller, SIGNAL(requestUrlChange(const KUrl&)),
- this, SIGNAL(urlChanged(const KUrl&)));
+ this, SIGNAL(slotRequestUrlChange(const KUrl&)));
connect(m_controller, SIGNAL(requestContextMenu(const QPoint&)),
this, SLOT(openContextMenu(const QPoint&)));
@@ -125,6 +125,8 @@
connect(m_controller, SIGNAL(viewportEntered()),
this, SLOT(clearHoverInformation()));
+ connect(m_dirLister, SIGNAL(redirection(KUrl, KUrl)),
+ this, SLOT(slotRedirection(KUrl, KUrl)));
connect(m_dirLister, SIGNAL(completed()),
this, SLOT(restoreCurrentItem()));
@@ -1203,4 +1205,16 @@
}
}
+void DolphinView::slotRequestUrlChange(const KUrl& url)
+{
+ emit requestUrlChange(url);
+ 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"
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinview.h #813953:813954
@@ -421,6 +421,12 @@
void urlChanged(const KUrl& url);
/**
+ * Is emitted if the view requests a changing of the current
+ * URL to \a url (see DolphinController::triggerUrlChangeRequest()).
+ */
+ void requestUrlChange(const KUrl& url);
+
+ /**
* Is emitted when clicking on an item with the left mouse button.
*/
void itemTriggered(const KFileItem& item);
@@ -596,6 +602,18 @@
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
+ */
+ void slotRequestUrlChange(const KUrl& url);
+
+ /**
* Restores the current item (= item that has the keyboard focus)
* to m_currentItemUrl.
*/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic