]> cloud.milkyroute.net Git - dolphin.git/commitdiff
dolphinview fix: don't emit urlChanged twice in DolphinView::setUrl (it's already...
authorDavid Faure <faure@kde.org>
Tue, 28 Aug 2007 21:47:20 +0000 (21:47 +0000)
committerDavid Faure <faure@kde.org>
Tue, 28 Aug 2007 21:47:20 +0000 (21:47 +0000)
dolphinpart fix: don't let the konq wheel spin forever when clicking on the Home button and we're already viewing $HOME.

svn path=/trunk/KDE/kdebase/apps/; revision=705916

src/dolphinpart.cpp
src/dolphinview.cpp

index 5d52c78a8d5489c8b97bc7c471c889397b0281e4..1bc1edac0575a2c1c6aaf0ecbbe9aa3f05e2b28d 100644 (file)
@@ -107,9 +107,13 @@ bool DolphinPart::openUrl(const KUrl& url)
     const QString prettyUrl = url.pathOrUrl();
     emit setWindowCaption(prettyUrl);
     emit m_extension->setLocationBarUrl(prettyUrl);
+    const bool reload = arguments().reload();
+    if (m_view->url() == url && !reload) { // DolphinView won't do anything in that case, so don't emit started
+        return true;
+    }
     setUrl(url); // remember it at the KParts level
     m_view->setUrl(url);
-    if (arguments().reload())
+    if (reload)
         m_view->reload();
     emit started(0); // get the wheel to spin
     return true;
index 073ab55898744d6cc0fee19cbc998ab8e623e3af..3a8d6a8eaff2ed79d53f2c06eaf597b03fcaa8de 100644 (file)
@@ -430,12 +430,11 @@ void DolphinView::setUrl(const KUrl& url)
         return;
     }
 
-    m_controller->setUrl(url);
+    m_controller->setUrl(url); // emits urlChanged, which we forward
 
     applyViewProperties(url);
 
     startDirLister(url);
-    emit urlChanged(url);
 }
 
 void DolphinView::mouseReleaseEvent(QMouseEvent* event)
@@ -917,7 +916,7 @@ void DolphinView::updateViewportColor()
 {
     QColor color = KColorScheme(KColorScheme::View).background();
     if (m_active) {
-        emit urlChanged(url());
+        emit urlChanged(url()); // Hmm, this is a hack; the url hasn't really changed.
         emit selectionChanged(selectedItems());
     } else {
         color.setAlpha(0);