]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Abort updateWindowTitle and activeViewChanged if not changed.
authorChris Rizzitello <rizzitello@kde.org>
Mon, 14 Jan 2019 01:55:07 +0000 (20:55 -0500)
committerChris Rizzitello <rizzitello@kde.org>
Wed, 16 Jan 2019 22:34:26 +0000 (17:34 -0500)
Summary:
 - Prevent activeViewChanged from updating the window if the view is the same view (happens at least once when starting up)
 - Stop updateWindowTitle from updating the title if its not changed.

Reviewers: #dolphin, elvisangelaccio, broulik

Reviewed By: #dolphin, elvisangelaccio, broulik

Subscribers: anthonyfieroni, broulik, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D17882

src/dolphinmainwindow.cpp
src/dolphintabpage.cpp

index c0446fa4ced7c66d876826fcb9fe253a288216ad..ae586bc34527dc86b7eca29885cb01afa49c1904 100644 (file)
@@ -1008,7 +1008,10 @@ void DolphinMainWindow::tabCountChanged(int count)
 
 void DolphinMainWindow::updateWindowTitle()
 {
-    setWindowTitle(m_activeViewContainer->caption());
+    const QString newTitle = m_activeViewContainer->caption();
+    if (windowTitle() != newTitle) {
+        setWindowTitle(newTitle);
+    }
 }
 
 void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath)
index 91fc7cfd8800f5582bc4a2910135fd47687b0e3a..0193aaad0a714164f9650a1688e3963e97a40fa3 100644 (file)
@@ -320,17 +320,18 @@ void DolphinTabPage::slotViewActivated()
 
     const DolphinView* newActiveView = activeViewContainer()->view();
 
-    if (newActiveView != oldActiveView) {
-        disconnect(oldActiveView, &DolphinView::urlChanged,
-                   this, &DolphinTabPage::activeViewUrlChanged);
-        disconnect(oldActiveView, &DolphinView::redirection,
-                   this, &DolphinTabPage::slotViewUrlRedirection);
-        connect(newActiveView, &DolphinView::urlChanged,
-                this, &DolphinTabPage::activeViewUrlChanged);
-        connect(newActiveView, &DolphinView::redirection,
-                this, &DolphinTabPage::slotViewUrlRedirection);
+    if (newActiveView == oldActiveView) {
+        return;
     }
 
+    disconnect(oldActiveView, &DolphinView::urlChanged,
+               this, &DolphinTabPage::activeViewUrlChanged);
+    disconnect(oldActiveView, &DolphinView::redirection,
+               this, &DolphinTabPage::slotViewUrlRedirection);
+    connect(newActiveView, &DolphinView::urlChanged,
+            this, &DolphinTabPage::activeViewUrlChanged);
+    connect(newActiveView, &DolphinView::redirection,
+            this, &DolphinTabPage::slotViewUrlRedirection);
     emit activeViewChanged(activeViewContainer());
     emit activeViewUrlChanged(activeViewContainer()->url());
 }