docprefs.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#include <ksimpleconfig.h>
00026
#include <kstandarddirs.h>
00027
#include <kdebug.h>
00028
00029
#include "docprefs.h"
00030
00031 KSimpleConfig *DocPrefs::mConfig = 0;
00032
00033 DocPrefs::DocPrefs(
const QString &type )
00034 {
00035
if ( !mConfig ) {
00036 mConfig =
new KSimpleConfig( locateLocal(
"data",
"korganizer/docprefs." + type +
".kconfig" ) );
00037 }
00038 }
00039
00040 DocPrefs::~DocPrefs()
00041 {
00042 mConfig->sync();
00043 }
00044
00045
void DocPrefs::setDoc(
const QString &identifier )
00046 {
00047 mDocId = identifier;
00048 }
00049
00050
QString DocPrefs::doc()
const
00051
{
00052
return mDocId;
00053 }
00054
00055
bool DocPrefs::readBoolEntry(
const QString &
id )
const
00056
{
00057 mConfig->setGroup( mDocId );
00058
bool result = mConfig->readBoolEntry(
id,
false );
00059
00060
return result;
00061 }
00062
00063
void DocPrefs::writeEntry(
const QString &
id,
bool value )
00064 {
00065
00066 mConfig->setGroup( mDocId );
00067 mConfig->writeEntry(
id, value );
00068 }
This file is part of the documentation for korganizer Library Version 3.3.0.