From kde-commits Thu Feb 05 21:30:21 2004 From: Ravikiran Rajagopal Date: Thu, 05 Feb 2004 21:30:21 +0000 To: kde-commits Subject: kdebase/ksplashml/kcmksplash Message-Id: <20040205213021.239BE9913 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=107604057417547 CVS commit by ravi: Show new theme when it is installed. M +31 -11 installer.cpp 1.15 M +1 -1 installer.h 1.4 --- kdebase/ksplashml/kcmksplash/installer.cpp #1.14:1.15 @@ -191,4 +191,18 @@ void SplashInstaller::addNewTheme(const } KArchiveDirectory const *ad = tarFile.directory(); + // Find first directory entry. + QStringList entries = ad->entries(); + QString themeName( entries.first() ); +#if 0 + // The isDirectory() call always returns false; why? + for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) + { + if ( ad->entry( *it )->isDirectory() ) + { + themeName = *it; + break; + } + } +#endif // TODO: Make sure we put the entries into a subdirectory if the tarball does not. // TODO: Warn the user if we overwrite something. @@ -199,4 +213,6 @@ void SplashInstaller::addNewTheme(const // TODO: Update only the entries from this installation. readThemesList(); + mThemesList->setCurrentItem(findTheme(themeName)); + mThemesList->setSelected(mThemesList->currentItem(), true); } @@ -208,5 +224,5 @@ void SplashInstaller::readThemesList() // Read local themes QStringList entryList = KGlobal::dirs()->resourceDirs("ksplashthemes"); - kdDebug() << entryList << endl; + //kdDebug() << "readThemesList: " << entryList << endl; QDir dir; QStringList subdirs; @@ -218,9 +234,13 @@ void SplashInstaller::readThemesList() continue; subdirs = dir.entryList( QDir::Dirs ); - kdDebug() << subdirs << endl; + // kdDebug() << "readThemesList: " << subdirs << endl; // TODO: Make sure it contains a *.rc file. for (QStringList::Iterator l = subdirs.begin(); l != subdirs.end(); l++ ) if ( !(*l).startsWith(QString(".")) ) + { + mThemesList->blockSignals( true ); // Don't activate any theme until all themes are loaded. addTheme(dir.path(),*l); + mThemesList->blockSignals( false ); + } } }