From 3ebb8cca124d70c5565656b26060892de551a880 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 26 Apr 2009 12:31:32 +0200 Subject: Removed KDE VERSION check. tabbar needs some love.. --- src/mainview.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mainview.cpp') 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(sender()); WebView *webView = qobject_cast(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; -- cgit v1.2.1