• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

filelight

  • sources
  • kde-4.12
  • kdeutils
  • filelight
  • src
  • part
Config.cpp
Go to the documentation of this file.
1 /***********************************************************************
2 * Copyright 2003-2004 Max Howell <max.howell@methylblue.com>
3 * Copyright 2008-2009 Martin Sandsmark <martin.sandsmark@kde.org>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License or (at your option) version 3 or any later version
9 * accepted by the membership of KDE e.V. (or its successor approved
10 * by the membership of KDE e.V.), which shall act as a proxy
11 * defined in Section 14 of version 3 of the license.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ***********************************************************************/
21 
22 #include "Config.h"
23 
24 #include <KConfig>
25 #include <KConfigGroup>
26 #include <KGlobal>
27 #include <KSharedConfig>
28 #include <KSharedPtr>
29 
30 bool Config::scanAcrossMounts;
31 bool Config::scanRemoteMounts;
32 bool Config::scanRemovableMedia;
33 bool Config::varyLabelFontSizes;
34 bool Config::showSmallFiles;
35 bool Config::antialias;
36 uint Config::contrast;
37 uint Config::minFontPitch;
38 uint Config::defaultRingDepth;
39 Filelight::MapScheme Config::scheme;
40 QStringList Config::skipList;
41 
42 void
43 Filelight::Config::read()
44 {
45  const KConfigGroup config = KGlobal::config()->group("filelight_part");
46 
47  scanAcrossMounts = config.readEntry("scanAcrossMounts", false);
48  scanRemoteMounts = config.readEntry("scanRemoteMounts", false);
49  scanRemovableMedia = config.readEntry("scanRemovableMedia", false);
50  varyLabelFontSizes = config.readEntry("varyLabelFontSizes", true);
51  showSmallFiles = config.readEntry("showSmallFiles", false);
52  contrast = config.readEntry("contrast", 75);
53  antialias = config.readEntry("antialias", true);
54  minFontPitch = config.readEntry("minFontPitch", QFont().pointSize() - 3);
55  scheme = (MapScheme) config.readEntry("scheme", 0);
56  skipList = config.readEntry("skipList", QStringList());
57 
58  defaultRingDepth = 4;
59 }
60 
61 void
62 Filelight::Config::write()
63 {
64  KConfigGroup config = KGlobal::config()->group("filelight_part");
65 
66  config.writeEntry("scanAcrossMounts", scanAcrossMounts);
67  config.writeEntry("scanRemoteMounts", scanRemoteMounts);
68  config.writeEntry("scanRemovableMedia", scanRemovableMedia);
69  config.writeEntry("varyLabelFontSizes", varyLabelFontSizes);
70  config.writeEntry("showSmallFiles", showSmallFiles);
71  config.writeEntry("contrast", contrast);
72  config.writeEntry("antialias", antialias);
73  config.writeEntry("minFontPitch", minFontPitch);
74  config.writeEntry("scheme", (int)scheme); // TODO: make the enum belong to a qwidget,
75  //and use magic macros to make it save this properly
76  config.writePathEntry("skipList", skipList);
77 }
Filelight::Config::scanRemoteMounts
static bool scanRemoteMounts
Definition: Config.h:44
Filelight::Config::read
static void read()
Definition: Config.cpp:43
Filelight::Config::contrast
static uint contrast
Definition: Config.h:48
Config.h
Filelight::Config::scanRemovableMedia
static bool scanRemovableMedia
Definition: Config.h:45
Filelight::Config::write
static void write()
Definition: Config.cpp:62
Filelight::Config::minFontPitch
static uint minFontPitch
Definition: Config.h:50
Filelight::Config::defaultRingDepth
static uint defaultRingDepth
Definition: Config.h:51
Filelight::Config::scheme
static MapScheme scheme
Definition: Config.h:53
Filelight::MapScheme
MapScheme
Definition: Config.h:31
Filelight::Config::antialias
static bool antialias
Definition: Config.h:49
Filelight::Config::showSmallFiles
static bool showSmallFiles
Definition: Config.h:47
Filelight::Config::skipList
static QStringList skipList
Definition: Config.h:54
Filelight::Config::varyLabelFontSizes
static bool varyLabelFontSizes
Definition: Config.h:46
Filelight::Config::scanAcrossMounts
static bool scanAcrossMounts
Definition: Config.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:08:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

filelight

Skip menu "filelight"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal