mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Update the controller's url upon redirection, otherwise pasting would paste into the old url. #186947
svn path=/trunk/KDE/kdebase/apps/; revision=1025406
This commit is contained in:
parent
1b160aee92
commit
4bccabca1b
4 changed files with 28 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>>&)),
|
||||
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue