diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-04-26 12:31:32 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-04-26 12:31:32 +0200 |
commit | 3ebb8cca124d70c5565656b26060892de551a880 (patch) | |
tree | 61eaa032f96cb2d294d06b5de69d79568d460ea1 /src/mainview.cpp | |
parent | DoxyFile (diff) | |
download | rekonq-3ebb8cca124d70c5565656b26060892de551a880.tar.xz |
Removed KDE VERSION check. tabbar needs some love..
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 2e30aa58..865ffab2 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -80,18 +80,12 @@ MainView::MainView(QWidget *parent) m_recentlyClosedTabsAction->setMenu(m_recentlyClosedTabsMenu); m_recentlyClosedTabsAction->setEnabled(false); - #if QT_VERSION >= 0x040500 - connect(m_tabBar, SIGNAL(closeRequest(int)), this, SLOT(closeTab(int))); - #if KDE_IS_VERSION(4,2,60) - setTabsClosable(true); // this causes #23 on KDE 4.2 - #else - setCloseButtonEnabled(true); // this is deprecated, remove for KDE >=4.3 - #endif - #endif - // -- connect(this, SIGNAL(loadUrlPage(const KUrl &)), this, SLOT(loadUrlInCurrentTab(const KUrl &))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); + + setTabsClosable(true); + connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotCloseTab(int))); } @@ -366,9 +360,11 @@ void MainView::slotReloadAllTabs() void MainView::windowCloseRequested() { + WebPage *webPage = qobject_cast<WebPage*>(sender()); WebView *webView = qobject_cast<WebView*>(webPage->view()); int index = webViewIndex(webView); + if (index >= 0) { if (count() == 1) @@ -380,6 +376,10 @@ void MainView::windowCloseRequested() slotCloseTab(index); } } + else + { + kWarning() << "Invalid tab index" << "line:" << __LINE__; + } } @@ -419,6 +419,7 @@ void MainView::slotCloneTab(int index) // When index is -1 index chooses the current tab void MainView::slotCloseTab(int index) { + kWarning() << "Index: " << index; // do nothing if just one tab is opened if( count() == 1 ) return; |