Bugfix: Now the form data and everything possible is restored when detaching a tab or duplicating a tab/window

BUG:114138

svn path=/trunk/KDE/kdebase/apps/; revision=854809
This commit is contained in:
Eduardo Robles Elvira 2008-08-30 10:57:28 +00:00
parent 7b4609c1c6
commit 234bbbc217

View file

@ -266,7 +266,7 @@ void KonqViewManager::duplicateTab( KonqFrameBase* currentFrame, bool openAfterC
QString prefix = KonqFrameBase::frameTypeToString(currentFrame->frameType()) + QString::number(0);
profileGroup.writeEntry( "RootItem", prefix );
prefix.append( QLatin1Char( '_' ) );
KonqFrameBase::Options flags = KonqFrameBase::saveURLs;
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
currentFrame->saveConfig( profileGroup, prefix, flags, 0L, 0, 1);
loadRootItem( profileGroup, tabContainer(), KUrl(), true, KUrl(), openAfterCurrentPage );
@ -276,10 +276,6 @@ void KonqViewManager::duplicateTab( KonqFrameBase* currentFrame, bool openAfterC
else
m_tabContainer->setCurrentIndex( m_tabContainer->count() - 1 );
KonqFrameBase* duplicatedFrame = dynamic_cast<KonqFrameBase*>(m_tabContainer->currentWidget());
if (duplicatedFrame)
duplicatedFrame->copyHistory( currentFrame );
#ifdef DEBUG_VIEWMGR
m_pMainWindow->dumpViewList();
printFullHierarchy();
@ -302,18 +298,13 @@ void KonqViewManager::breakOffTab( KonqFrameBase* currentFrame, const QSize& win
QString prefix = KonqFrameBase::frameTypeToString(currentFrame->frameType()) + QString::number(0);
profileGroup.writeEntry( "RootItem", prefix );
prefix.append( QLatin1Char( '_' ) );
KonqFrameBase::Options flags = KonqFrameBase::saveURLs;
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
currentFrame->saveConfig( profileGroup, prefix, flags, 0L, 0, 1);
KonqMainWindow *mainWindow = new KonqMainWindow(KUrl(), m_pMainWindow->xmlFile());
mainWindow->viewManager()->loadViewProfileFromConfig( config, QString(), currentProfile() );
KonqFrameTabs * kft = mainWindow->viewManager()->tabContainer();
KonqFrameBase *newFrame = dynamic_cast<KonqFrameBase*>(kft->currentWidget());
if(newFrame)
newFrame->copyHistory( currentFrame );
removeTab( currentFrame, false );
mainWindow->enableAllActions( true );
@ -1526,11 +1517,10 @@ KonqMainWindow* KonqViewManager::duplicateWindow()
tempFile.open();
KConfig config( tempFile.fileName() );
KConfigGroup profileGroup( &config, "Profile" );
KonqFrameBase::Options flags = KonqFrameBase::saveURLs;
KonqFrameBase::Options flags = KonqFrameBase::saveHistoryItems;
saveViewProfileToGroup(profileGroup, flags);
KonqMainWindow *mainWindow = openSavedWindow(profileGroup);
mainWindow->copyHistory( m_pMainWindow->childFrame() );
#ifndef NDEBUG
mainWindow->viewManager()->printFullHierarchy();
#endif