kilobyte is kB not kb
[kdepim.git] / messageviewer / globalsettings.cpp
blobcf1c37c864edd44889df9ad1dd01699ad4f76df0
1 /*
2 This file is part of KMail.
4 Copyright (c) 2005 David Faure <faure@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2,
8 as published by the Free Software Foundation.
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
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution.
25 #include <config-messageviewer.h>
27 #include "globalsettings.h"
28 #include <QTimer>
30 using namespace MessageViewer;
32 GlobalSettings *GlobalSettings::mSelf = 0;
34 GlobalSettings *GlobalSettings::self()
36 if ( !mSelf ) {
37 mSelf = new GlobalSettings();
38 mSelf->readConfig();
41 return mSelf;
44 GlobalSettings::GlobalSettings()
46 mConfigSyncTimer = new QTimer( this );
47 mConfigSyncTimer->setSingleShot( true );
48 connect( mConfigSyncTimer, SIGNAL(timeout()), this, SLOT(slotSyncNow()) );
51 void GlobalSettings::requestSync()
53 if ( !mConfigSyncTimer->isActive() )
54 mConfigSyncTimer->start( 0 );
57 void GlobalSettings::slotSyncNow()
59 config()->sync();
62 GlobalSettings::~GlobalSettings()
66 #include "globalsettings.moc"