summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-02-16 01:47:08 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-02-17 17:16:57 +0100
commit88a5c9816cd6a07240a4a94820e0a809aecd074a (patch)
tree73bb9984dc8543115ff3a998ea2fe7bcfc477b50 /src/mainview.cpp
parentAdd opensearch description file for bing and yahoo suggestions (diff)
downloadrekonq-88a5c9816cd6a07240a4a94820e0a809aecd074a.tar.xz
Cleans up "tab switch" management and expecially the use of signals
on that. This, expecially to avoid double calls on functions to manage tab switching and info updating. Reviewed by NOBODY (oops...)
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index fe6413a1..dfa202dc 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -112,7 +112,6 @@ void MainView::postLaunch()
// Session Manager
connect(this, SIGNAL(tabsChanged()), Application::sessionManager(), SLOT(saveSession()));
- connect(this, SIGNAL(currentChanged(int)), Application::sessionManager(), SLOT(saveSession()));
m_addTabButton->setDefaultAction(m_parentWindow->actionByName("new_tab"));
@@ -267,6 +266,8 @@ void MainView::currentChanged(int index)
tab->view()->setFocus();
tabBar()->resetTabHighlighted(index);
+
+ emit tabsChanged();
}
@@ -316,9 +317,13 @@ WebTab *MainView::newWebTab(bool focused)
{
setCurrentWidget(tab);
}
-
- emit tabsChanged();
-
+ else
+ {
+ // if tab is not focused,
+ // current index doesn't change...
+ emit tabsChanged();
+ }
+
return tab;
}
@@ -484,7 +489,9 @@ void MainView::closeTab(int index, bool del)
tabToClose->deleteLater();
}
- emit tabsChanged();
+ // if tab was not focused, current index does not change...
+ if(index != currentIndex())
+ emit tabsChanged();
}
@@ -594,6 +601,7 @@ void MainView::webViewUrlChanged(const QUrl &url)
}
if (ReKonfig::hoveringTabOption() == 2)
tabBar()->setTabToolTip(index, webTab(index)->url().toMimeDataString());
+
emit tabsChanged();
}