1
/***************************************************************************
2
* Copyright (C) 2009 by Wang Hoi <zealot.hoi@gmail.com> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
20
#include "kimpanelsettings.h"
21
#include <kdirwatch.h>
22
#include <kstandarddirs.h>
30
SettingsHelper() : q(0) {}
31
// q is also static, no need to delete it here
35
K_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
36
Settings *Settings::self()
38
if (!s_globalSettings->q) {
39
s_globalSettings->q = new Settings;
40
s_globalSettings->q->readConfig();
43
return s_globalSettings->q;
48
//FIXME: if/when kconfig gets change notification, this will be unnecessary
49
KDirWatch::self()->addFile(KStandardDirs::locateLocal("config", "kimpanelrc"));
50
connect(KDirWatch::self(), SIGNAL(created(const QString &)), this, SLOT(settingsFileChanged()));
51
connect(KDirWatch::self(), SIGNAL(dirty(const QString &)), this, SLOT(settingsFileChanged()));
58
void Settings::settingsFileChanged()
65
// vim: sw=4 sts=4 et tw=100