not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / screensaver / saverconfig.cpp
blob51a5e0e10128699cf41d89d8f14052f334229abc
1 #include <kdesktopfile.h>
2 #include <klocale.h>
3 #include <kconfiggroup.h>
4 #include "saverconfig.h"
6 SaverConfig::SaverConfig()
10 bool SaverConfig::read(const QString &file)
12 KDesktopFile config(file);
13 const KConfigGroup group = config.desktopGroup();
14 #if 0
15 if( !config.tryExec())
16 return false;
17 #endif
18 mExec = group.readPathEntry("Exec", QString());
19 mName = group.readEntry("Name");
20 QString categoryName = group.readEntry("X-KDE-Category");
21 if(categoryName.isEmpty())
22 mCategory = categoryName;
23 else
24 mCategory = i18nc("Screen saver category", // Must be same in CMakeFiles.txt
25 categoryName.toUtf8());
27 if (config.hasActionGroup("Setup"))
29 mSetup = config.actionGroup("Setup").readPathEntry("Exec", QString());
32 if (config.hasActionGroup("InWindow"))
34 mSaver = config.actionGroup("InWindow").readPathEntry("Exec", QString());
37 int indx = file.lastIndexOf('/');
38 if (indx >= 0) {
39 mFile = file.mid(indx+1);
42 return !mSaver.isEmpty();