summaryrefslogtreecommitdiffstats
path: root/krusader/DiskUsage/filelightParts/Config.cpp
blob: 48d506509d2013a3ab3f32ed084c39da32a2bc6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#include "Config.h"
#include <tdeconfig.h>
#include <kglobal.h>


bool Config::varyLabelFontSizes = true;
bool Config::showSmallFiles = false;
uint Config::contrast = 50;
uint Config::antiAliasFactor = 2;
uint Config::minFontPitch = 10;
uint Config::defaultRingDepth = 4;
Filelight::MapScheme Config::scheme;


inline TDEConfig&
Filelight::Config::tdeconfig()
{
    TDEConfig *config = TDEGlobal::config();
    config->setGroup( "DiskUsage" );
    return *config;
}

void
Filelight::Config::read()
{
    const TDEConfig &config = tdeconfig();

    varyLabelFontSizes = config.readBoolEntry( "varyLabelFontSizes", true );
    showSmallFiles     = config.readBoolEntry( "showSmallFiles", false );
    contrast           = config.readNumEntry( "contrast", 50 );
    antiAliasFactor    = config.readNumEntry( "antiAliasFactor", 2 );
    minFontPitch       = config.readNumEntry( "minFontPitch", TQFont().pointSize() - 3);
    scheme = (MapScheme) config.readNumEntry( "scheme", 0 );

    defaultRingDepth   = 4;
}

void
Filelight::Config::write()
{
    TDEConfig &config = tdeconfig();

    config.writeEntry( "varyLabelFontSizes", varyLabelFontSizes );
    config.writeEntry( "showSmallFiles", showSmallFiles);
    config.writeEntry( "contrast", contrast );
    config.writeEntry( "antiAliasFactor", antiAliasFactor );
    config.writeEntry( "minFontPitch", minFontPitch );
    config.writeEntry( "scheme", scheme );
}