[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/ksplashml/kcmksplash
From:       Ravikiran Rajagopal <ravi () kde ! org>
Date:       2004-02-05 21:30:21
Message-ID: 20040205213021.239BE9913 () office ! kde ! org
[Download RAW message or body]

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 );
+      }
   }
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic