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