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

List:       kde-commits
Subject:    kdeartwork/kscreensaver/kxsconfig
From:       Chris Howells <howells () kde ! org>
Date:       2003-08-26 9:18:41
[Download RAW message or body]

CVS commit by howells: 

Make the preview find the right screensaver


  M +11 -2     kxsconfig.cpp   1.23


--- kdeartwork/kscreensaver/kxsconfig/kxsconfig.cpp  #1.22:1.23
@@ -42,4 +42,5 @@
 #include <qvbox.h>
 #include <qlabel.h>
+#include <qfileinfo.h>
 
 #include <kdebug.h>
@@ -223,6 +224,14 @@ void KXSConfigDialog::slotPreviewExited(
         saver = saver.stripWhiteSpace();
         while ( !saver[i].isSpace() ) word += saver[i++];
-        QString path = KStandardDirs::findExe(word, XSCREENSAVER_HACKS_DIR);
-
+        //work around a KStandarDirs::findExe() "feature" where it looks in \
$KDEDIR/bin first no matter what and sometimes finds the wrong executable +        \
QFileInfo checkExe; +        QString saverdir = \
QString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(word); +        kdDebug() << \
"saverdir is" << saverdir << endl; +        QString path;
+        checkExe.setFile(saverdir);
+        if (checkExe.exists() && checkExe.isExecutable() && checkExe.isFile())
+        {
+                path = saverdir;
+        }
         if (!path.isEmpty()) {
             (*mPreviewProc) << path;


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

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