Commit bae52bf7 authored by Stephan Binner's avatar Stephan Binner
Browse files

Bug 89245: open new tab after current tab does not work (normal)

svn path=/trunk/kdebase/konqueror/; revision=349280
parent b5fd9aca
......@@ -2459,12 +2459,16 @@ void KonqMainWindow::slotAddTab()
void KonqMainWindow::slotDuplicateTab()
{
m_pViewManager->duplicateTab();
KConfig *config = KGlobal::config();
KConfigGroupSaver cs( config, QString::fromLatin1("FMSettings") );
m_pViewManager->duplicateTab( 0, config->readBoolEntry( "OpenAfterCurrentPage", false ) );
}
void KonqMainWindow::slotDuplicateTabPopup()
{
m_pViewManager->duplicateTab( m_pWorkingTab );
KConfig *config = KGlobal::config();
KConfigGroupSaver cs( config, QString::fromLatin1("FMSettings") );
m_pViewManager->duplicateTab( m_pWorkingTab, config->readBoolEntry( "OpenAfterCurrentPage", false ) );
}
void KonqMainWindow::slotBreakOffTab()
......
......@@ -348,7 +348,7 @@ KonqView* KonqViewManager::addTab(const QString &serviceType, const QString &ser
return childView;
}
void KonqViewManager::duplicateTab( KonqFrameBase* tab )
void KonqViewManager::duplicateTab( KonqFrameBase* tab, bool openAfterCurrentPage )
{
#ifdef DEBUG_VIEWMGR
kdDebug(1202) << "---------------- KonqViewManager::duplicateTab( " << tab << " ) --------------" << endl;
......@@ -400,7 +400,7 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab )
// from profile loading (e.g. in switchView)
m_bLoadingProfile = true;
loadItem( config, tabContainer, rootItem, KURL(""), true );
loadItem( config, tabContainer, rootItem, KURL(""), true, openAfterCurrentPage );
m_bLoadingProfile = false;
......@@ -410,6 +410,9 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab )
// so we do it once at the end :
m_pMainWindow->viewCountChanged();
if (openAfterCurrentPage)
tabContainer->setCurrentPage( tabContainer->currentPageIndex () + 1 );
else
tabContainer->setCurrentPage( tabContainer->count() - 1 );
KonqFrameBase* duplicatedFrame = dynamic_cast<KonqFrameBase*>(tabContainer->currentPage());
......@@ -1412,7 +1415,7 @@ QSize KonqViewManager::readConfigSize( KConfig &cfg, QWidget *widget )
}
void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
const QString &name, const KURL & defaultURL, bool openURL )
const QString &name, const KURL & defaultURL, bool openURL, bool openAfterCurrentPage )
{
QString prefix;
if( name != "InitialView" )
......@@ -1441,7 +1444,7 @@ void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
bool passiveMode = cfg.readBoolEntry( QString::fromLatin1( "PassiveMode" ).prepend( prefix ), false );
//kdDebug(1202) << "Creating View Stuff" << endl;
KonqView *childView = setupView( parent, viewFactory, service, partServiceOffers, appServiceOffers, serviceType, passiveMode );
KonqView *childView = setupView( parent, viewFactory, service, partServiceOffers, appServiceOffers, serviceType, passiveMode, openAfterCurrentPage );
if (!childView->isFollowActive()) childView->setLinkedView( cfg.readBoolEntry( QString::fromLatin1( "LinkedView" ).prepend( prefix ), false ) );
childView->setToggleView( cfg.readBoolEntry( QString::fromLatin1( "ToggleView" ).prepend( prefix ), false ) );
......
......@@ -103,7 +103,7 @@ public:
/**
* Duplicates the specified tab, or else the current one if none is specified
*/
void duplicateTab( KonqFrameBase* tab = 0L );
void duplicateTab( KonqFrameBase* tab = 0L, bool openAfterCurrentPage = false );
/**
* Break the current tab off into a new window,
......@@ -303,7 +303,7 @@ protected:
* (this is set to false when we have a forcedURL to open)
*/
void loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
const QString &name, const KURL & defaultURL, bool openURL );
const QString &name, const KURL & defaultURL, bool openURL, bool openAfterCurrentPage = false );
// Disabled - we do it ourselves
virtual void setActiveInstance( KInstance * ) {}
......
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