Fix akonadimodel.cpp:1: warning: unterminated character constant
[kdepim.git] / ktimetracker / preferences.cpp
blob8722fdf8efdb05152c0da2698885155d3f20ae73
1 /*
2 * Copyright (C) 2000 by Jesper Pedersen <blackie@kde.org>
3 * 2007 the ktimetracker developers
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the
17 * Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor
19 * Boston, MA 02110-1301 USA.
23 #include "preferences.h"
25 #include <KConfig>
26 #include <KGlobal>
28 Preferences *Preferences::mInstance = 0;
30 Preferences::Preferences()
34 Preferences *Preferences::instance()
36 if ( !mInstance )
38 mInstance = new Preferences;
40 return mInstance;
43 bool Preferences::readBoolEntry( const QString& key )
45 return KGlobal::config()->group( QString() ).readEntry( key, true );
48 void Preferences::writeEntry( const QString &key, bool value)
50 KConfigGroup config = KGlobal::config()->group( QString() );
51 config.writeEntry( key, value );
52 config.sync();
55 void Preferences::deleteEntry( const QString &key )
57 KConfigGroup config = KGlobal::config()->group( QString() );
58 config.deleteEntry( key );
59 config.sync();
62 #include "preferences.moc"