]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Update the controller's url upon redirection, otherwise pasting would paste into...
authorDavid Faure <faure@kde.org>
Fri, 18 Sep 2009 17:14:03 +0000 (17:14 +0000)
committerDavid Faure <faure@kde.org>
Fri, 18 Sep 2009 17:14:03 +0000 (17:14 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1025406

src/dolphincontroller.cpp
src/dolphincontroller.h
src/dolphinview.cpp
src/dolphinview.h

index bf26df62670128c7375ae654fe874d1d5a00494c..89d6509ca42c0e9edc62af903649bd6af0b0d171 100644 (file)
@@ -52,6 +52,11 @@ void DolphinController::setUrl(const KUrl& url)
     }
 }
 
+void DolphinController::redirectToUrl(const KUrl& url)
+{
+    m_url = url;
+}
+
 void DolphinController::setItemView(QAbstractItemView* view)
 {
     if (m_itemView != 0) {
index bd2189e21730565cf6fd7679667c1cec66680cb5..8aebdcac47338396b22b57132d0e36b4db6d18b1 100644 (file)
@@ -97,6 +97,12 @@ public:
     void setUrl(const KUrl& url);
     const KUrl& url() const;
 
+    /**
+     * Sets the URL to \a url and does nothing else. Called when
+     * a redirection happens.
+     */
+    void redirectToUrl(const KUrl& url);
+
     /**
      * Changes the current item view where the controller is working. This
      * is only necessary for views like the tree view, where internally
@@ -165,7 +171,7 @@ public:
     void indicateSortOrderChange(Qt::SortOrder order);
 
     /**
-     * Informs the abstract Dolphin view about a change between separate sorting 
+     * Informs the abstract Dolphin view about a change between separate sorting
      * (with folders first) and mixed sorting of files and folders done inside
      * the view implementation. This method should be invoked by the view
      * implementation (e. g. the details view uses this method in combination
index 56825816828629936df345cd508124c4f82b87eb..5ae81f31da0665f1391d6323e4153bc947c3f97b 100644 (file)
@@ -134,8 +134,8 @@ DolphinView::DolphinView(QWidget* parent,
             this, SLOT(clearHoverInformation()));
 
     KDirLister* dirLister = m_viewAccessor.dirLister();
-    connect(dirLister, SIGNAL(redirection(KUrl, KUrl)),
-            this, SIGNAL(redirection(KUrl, KUrl)));
+    connect(dirLister, SIGNAL(redirection(KUrl,KUrl)),
+            this, SLOT(slotRedirection(KUrl,KUrl)));
     connect(dirLister, SIGNAL(completed()),
             this, SLOT(slotDirListerCompleted()));
     connect(dirLister, SIGNAL(refreshItems(const QList<QPair<KFileItem,KFileItem>>&)),
@@ -246,7 +246,7 @@ void DolphinView::setMode(Mode mode)
     emit modeChanged();
 
     updateZoomLevel(oldZoomLevel);
-    if (m_showPreview) {   
+    if (m_showPreview) {
         loadDirectory(viewPropsUrl);
     }
 }
@@ -625,7 +625,7 @@ void DolphinView::renameSelectedItems()
             return;
         }
         delete dialog;
-        
+
         // the selection would be invalid after renaming the items, so just clear
         // it before
         clearSelection();
@@ -1500,4 +1500,10 @@ KDirLister* DolphinView::ViewAccessor::dirLister() const
     return dirModel()->dirLister();
 }
 
+void DolphinView::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
+{
+    emit redirection(oldUrl, newUrl);
+    m_controller->redirectToUrl(newUrl); // #186947
+}
+
 #include "dolphinview.moc"
index 57bf5d2f9253dc569b928e46b76563895763976f..b0d78482a2b28aa8087c4cd98a2cee8dd10f0552 100644 (file)
@@ -694,6 +694,12 @@ private slots:
      */
     void restoreSelection();
 
+    /**
+     * Called when a redirection happens.
+     * Testcase: fish://localhost
+     */
+    void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+
 private:
     void loadDirectory(const KUrl& url, bool reload = false);