summaryrefslogtreecommitdiffstats
path: root/src/part/Config.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:26:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-03 01:26:04 +0000
commit3c7b870f367df150ea60eb9d6bb2fd41646545d7 (patch)
treeac8705b4703cebb5031f9443eafd3e429a17ac1a /src/part/Config.cpp
downloadfilelight-3c7b870f367df150ea60eb9d6bb2fd41646545d7.tar.gz
filelight-3c7b870f367df150ea60eb9d6bb2fd41646545d7.zip
Added abandoned Filelight application
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/filelight@1084392 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/part/Config.cpp')
-rw-r--r--src/part/Config.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/part/Config.cpp b/src/part/Config.cpp
new file mode 100644
index 0000000..8d2f6b8
--- /dev/null
+++ b/src/part/Config.cpp
@@ -0,0 +1,62 @@
+
+#include "Config.h"
+#include <kconfig.h>
+#include <kglobal.h>
+
+
+bool Config::scanAcrossMounts;
+bool Config::scanRemoteMounts;
+bool Config::scanRemovableMedia;
+bool Config::varyLabelFontSizes;
+bool Config::showSmallFiles;
+uint Config::contrast;
+uint Config::antiAliasFactor;
+uint Config::minFontPitch;
+uint Config::defaultRingDepth;
+Filelight::MapScheme Config::scheme;
+QStringList Config::skipList;
+
+
+inline KConfig&
+Filelight::Config::kconfig()
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup( "filelight_part" );
+ return *config;
+}
+
+void
+Filelight::Config::read()
+{
+ const KConfig &config = kconfig();
+
+ scanAcrossMounts = config.readBoolEntry( "scanAcrossMounts", false );
+ scanRemoteMounts = config.readBoolEntry( "scanRemoteMounts", false );
+ scanRemovableMedia = config.readBoolEntry( "scanRemovableMedia", false );
+ varyLabelFontSizes = config.readBoolEntry( "varyLabelFontSizes", true );
+ showSmallFiles = config.readBoolEntry( "showSmallFiles", false );
+ contrast = config.readNumEntry( "contrast", 75 );
+ antiAliasFactor = config.readNumEntry( "antiAliasFactor", 2 );
+ minFontPitch = config.readNumEntry( "minFontPitch", QFont().pointSize() - 3);
+ scheme = (MapScheme) config.readNumEntry( "scheme", 0 );
+ skipList = config.readPathListEntry( "skipList" );
+
+ defaultRingDepth = 4;
+}
+
+void
+Filelight::Config::write()
+{
+ KConfig &config = kconfig();
+
+ config.writeEntry( "scanAcrossMounts", scanAcrossMounts );
+ config.writeEntry( "scanRemoteMounts", scanRemoteMounts );
+ config.writeEntry( "scanRemovableMedia", scanRemovableMedia );
+ config.writeEntry( "varyLabelFontSizes", varyLabelFontSizes );
+ config.writeEntry( "showSmallFiles", showSmallFiles);
+ config.writeEntry( "contrast", contrast );
+ config.writeEntry( "antiAliasFactor", antiAliasFactor );
+ config.writeEntry( "minFontPitch", minFontPitch );
+ config.writeEntry( "scheme", scheme );
+ config.writePathEntry( "skipList", skipList );
+}