KDE/kdebase/apps/konqueror/src
Eduardo Robles Elvira
edulix at gmail.com
Wed Apr 16 07:21:53 BST 2008
SVN commit 797486 by edulix:
As can be seen in KonqFrameContainer::saveConfig(), that function doesn't
necesarily save two childs. But when KonqViewManager::loadItem() is loading a
container it wants the container to have obligatory two childs, otherwise it
shows with kDebug() a "profile loading error" and loads a default url. Fixing
loadItem().
For more info see thread in kfm-devel: http://lists.kde.org/?l=kfm-devel&m=120790605409686&w=2
CCMAIL:kfm-devel at kde.org
M +26 -1 konqviewmanager.cpp
--- trunk/KDE/kdebase/apps/konqueror/src/konqviewmanager.cpp #797485:797486
@@ -1247,11 +1247,36 @@
int index = cfg.readEntry( QString::fromLatin1( "activeChildIndex" ).prepend(prefix), -1 );
QStringList childList = cfg.readEntry( QString::fromLatin1( "Children" ).prepend( prefix ),QStringList() );
- if( childList.count() < 2 )
+ if( childList.count() == 0 )
{
kWarning() << "Profile Loading Error: Less than two children in " << name ;
// fallback to defaults
loadItem( cfg, parent, "InitialView", defaultURL, openUrl, forcedUrl );
+ } else if( childList.count() == 1 )
+ {
+
+ if ( !m_tabContainer ) {
+ createTabContainer(parent->asQWidget(), parent);
+ parent->insertChildFrame( m_tabContainer );
+ }
+
+ loadItem( cfg, tabContainer(), childList.at(0), defaultURL, openUrl, forcedUrl );
+ QWidget* currentPage = m_tabContainer->currentWidget();
+ if (currentPage != 0L) {
+ KonqView* activeChildView = dynamic_cast<KonqFrameBase*>(currentPage)->activeChildView();
+ if (activeChildView != 0L) {
+ activeChildView->setCaption( activeChildView->caption() );
+ activeChildView->setTabIcon( activeChildView->url() );
+ }
+ }
+
+ QWidget* w = m_tabContainer->widget(index);
+ Q_ASSERT(w);
+ m_tabContainer->setActiveChild( dynamic_cast<KonqFrameBase*>(w) );
+ m_tabContainer->setCurrentIndex( index );
+ m_tabContainer->show();
+
+
}
else
{
More information about the kfm-devel
mailing list