CVS commit by binner:
Hidden option for Bug 82957: Middle click on tab to close in Konqueror (wishlist)
CCMAIL:
82957-done@bugs.kde.org
M +10 -0 konq_tabs.cc 1.55
M +1 -0 konq_tabs.h 1.20
--- kdebase/konqueror/konq_tabs.cc #1.54:1.55
@@ -121,4 +121,5 @@ KonqFrameTabs::KonqFrameTabs(QWidget* pa
KConfigGroupSaver cs( config, QString::fromLatin1("FMSettings") );
+ m_MouseMiddleClickClosesTab = config->readBoolEntry( "MouseMiddleClickClosesTab", false );
m_maxLength = config->readNumEntry("MaximumTabLength", 30);
m_minLength = config->readNumEntry("MinimumTabLength", 3);
@@ -512,4 +513,12 @@ void KonqFrameTabs::slotMouseMiddleClick
void KonqFrameTabs::slotMouseMiddleClick( QWidget *w )
{
+ if ( m_MouseMiddleClickClosesTab ) {
+ if ( m_pChildFrameList->count() > 1 ) {
+ // Yes, I know this is an unchecked dynamic_cast - I'm casting sideways in a class hierarchy and it could crash one day, but I haven't checked setWorkingTab so I don't know if it can handle nulls.
+ m_pViewManager->mainWindow()->setWorkingTab( dynamic_cast<KonqFrameBase*>(w) );
+ emit ( removeTabPopup() );
+ }
+ }
+ else {
QApplication::clipboard()->setSelectionMode( QClipboard:
election );
KURL filteredURL ( KonqMisc::konqFilteredURL( this, QApplication::clipboard()->text() ) );
@@ -520,4 +529,5 @@ void KonqFrameTabs::slotMouseMiddleClick
}
}
+ }
}
--- kdebase/konqueror/konq_tabs.h #1.19:1.20
@@ -128,4 +128,5 @@ private:
bool m_permanentCloseButtons;
bool m_alwaysTabBar;
+ bool m_MouseMiddleClickClosesTab;
};