┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2009-09-18 17:14:03 +0000
committerDavid Faure <[email protected]>2009-09-18 17:14:03 +0000
commit4bccabca1bd705f24a35ed1ea31fc6d185c2b442 (patch)
tree8a9f23ea5660e02c5ec1219cf7259015a0a7fa38
parent1b160aee92af8bd215f88f524683c7214f497f90 (diff)
Update the controller's url upon redirection, otherwise pasting would paste into the old url. #186947
svn path=/trunk/KDE/kdebase/apps/; revision=1025406
-rw-r--r--src/dolphincontroller.cpp5
-rw-r--r--src/dolphincontroller.h8
-rw-r--r--src/dolphinview.cpp14
-rw-r--r--src/dolphinview.h6
4 files changed, 28 insertions, 5 deletions
diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp
index bf26df626..89d6509ca 100644
--- a/src/dolphincontroller.cpp
+++ b/src/dolphincontroller.cpp
@@ -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) {
diff --git a/src/dolphincontroller.h b/src/dolphincontroller.h
index bd2189e21..8aebdcac4 100644
--- a/src/dolphincontroller.h
+++ b/src/dolphincontroller.h
@@ -98,6 +98,12 @@ public:
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
* several QAbstractItemView instances are used.
@@ -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
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 568258168..5ae81f31d 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -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"
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 57bf5d2f9..b0d78482a 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -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);