diff options
Diffstat (limited to 'kcontrol/screensaver/scrnsave.cpp')
-rw-r--r-- | kcontrol/screensaver/scrnsave.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/kcontrol/screensaver/scrnsave.cpp b/kcontrol/screensaver/scrnsave.cpp index 776c8e43a..8980c8e3c 100644 --- a/kcontrol/screensaver/scrnsave.cpp +++ b/kcontrol/screensaver/scrnsave.cpp @@ -27,6 +27,7 @@ #include <tqpushbutton.h> #include <tqslider.h> #include <tqtimer.h> +#include <tqfileinfo.h> #include <tqwhatsthis.h> #include <dcopclient.h> @@ -519,9 +520,28 @@ void KScreenSaver::findSavers() TQString file = mSaverFileList[mNumLoaded]; SaverConfig *saver = new SaverConfig; if (saver->read(file)) { - mSaverList.append(saver); - } else + TQString saverexec = TQString("%1/%2").arg(XSCREENSAVER_HACKS_DIR).arg(saver->exec()); + // find the xscreensaver executable + //work around a TDEStandardDirs::findExe() "feature" where it looks in $TDEDIR/bin first no matter what and sometimes finds the wrong executable + TQFileInfo checkExe; + checkExe.setFile(saverexec); + if (checkExe.exists() && checkExe.isExecutable() && checkExe.isFile()) { + mSaverList.append(saver); + } + else { + // Executable not present in XScreenSaver directory! + // Try standard paths + if (TDEStandardDirs::findExe(saver->exec()) != TQString::null) { + mSaverList.append(saver); + } + else { + delete saver; + } + } + } + else { delete saver; + } } if ( (unsigned)mNumLoaded == mSaverFileList.count() ) { |