Assure that no reloading is done if KDirLister emits a redirection, only change the the URL. Thanks to David Faure and Albert Alstals Cid for the detailed analysis!

BUG: 155591

svn path=/trunk/KDE/kdebase/apps/; revision=875554
This commit is contained in:
Peter Penz 2008-10-24 19:52:28 +00:00
parent 6f49557ceb
commit dc6bd8046f
4 changed files with 27 additions and 15 deletions

View file

@ -126,7 +126,7 @@ DolphinView::DolphinView(QWidget* parent,
this, SLOT(clearHoverInformation()));
connect(m_dirLister, SIGNAL(redirection(KUrl, KUrl)),
this, SLOT(slotRedirection(KUrl, KUrl)));
this, SIGNAL(redirection(KUrl, KUrl)));
connect(m_dirLister, SIGNAL(completed()),
this, SLOT(restoreCurrentItem()));
@ -1027,13 +1027,6 @@ void DolphinView::slotDeleteFileFinished(KJob* job)
}
}
void DolphinView::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
{
if (oldUrl == m_controller->url()) {
m_controller->setUrl(newUrl);
}
}
void DolphinView::slotRequestUrlChange(const KUrl& url)
{
emit requestUrlChange(url);

View file

@ -85,7 +85,8 @@ public:
{
/**
* The directory items are shown as icons including an
* icon name. */
* icon name.
*/
IconsView = 0,
/**
@ -525,6 +526,12 @@ signals:
*/
void startedPathLoading(const KUrl& url);
/**
* Emitted when KDirLister emits redirection.
* Testcase: fish://localhost
*/
void redirection(const KUrl& oldUrl, const KUrl& newUrl);
protected:
/** @see QWidget::mouseReleaseEvent */
virtual void mouseReleaseEvent(QMouseEvent* event);
@ -607,12 +614,6 @@ private slots:
*/
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

View file

@ -140,6 +140,8 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
this, SLOT(slotItemTriggered(KFileItem)));
connect(m_view, SIGNAL(startedPathLoading(const KUrl&)),
this, SLOT(saveRootUrl(const KUrl&)));
connect(m_view, SIGNAL(redirection(KUrl, KUrl)),
this, SLOT(redirect(KUrl, KUrl)));
connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(restoreView(const KUrl&)));
@ -370,6 +372,15 @@ void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event)
DolphinDropController::dropUrls(KFileItem(), destination, event, this);
}
void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)
{
Q_UNUSED(oldUrl);
const bool block = m_urlNavigator->signalsBlocked();
m_urlNavigator->blockSignals(true);
m_urlNavigator->setUrl(newUrl);
m_urlNavigator->blockSignals(block);
}
void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
{
KUrl url = item.targetUrl();

View file

@ -212,6 +212,13 @@ private slots:
* above the destination \a destination.
*/
void dropUrls(const KUrl& destination, QDropEvent* event);
/**
* Is invoked when a redirection is done and changes the
* URL of the URL navigator to \a newUrl without triggering
* a reloading of the directory.
*/
void redirect(const KUrl& oldUrl, const KUrl& newUrl);
private:
bool m_showProgress;