ktimetracker
preferences.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "preferences.h"
00024
00025 #include <KConfig>
00026 #include <KGlobal>
00027
00028 Preferences *Preferences::mInstance = 0;
00029
00030 Preferences::Preferences()
00031 {
00032 }
00033
00034 Preferences *Preferences::instance()
00035 {
00036 if ( !mInstance ) {
00037 mInstance = new Preferences;
00038 }
00039
00040 return mInstance;
00041 }
00042
00043 bool Preferences::readBoolEntry( const QString& key )
00044 {
00045 return KGlobal::config()->group( QString() ).readEntry( key, true );
00046 }
00047
00048 void Preferences::writeEntry( const QString &key, bool value)
00049 {
00050 KConfigGroup config = KGlobal::config()->group( QString() );
00051 config.writeEntry( key, value );
00052 config.sync();
00053 }
00054
00055 void Preferences::deleteEntry( const QString &key )
00056 {
00057 KConfigGroup config = KGlobal::config()->group( QString() );
00058 config.deleteEntry( key );
00059 config.sync();
00060 }
00061
00062 #include "preferences.moc"