Commit 784734ca authored by Chris Rizzitello's avatar Chris Rizzitello

Abort updateWindowTitle and activeViewChanged if not changed.

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
parent d23b842a
......@@ -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)
......
......@@ -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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment