kmail
globalsettings.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "globalsettings.h"
00025 #include <kstaticdeleter.h>
00026 #include <qtimer.h>
00027
00028 GlobalSettings *GlobalSettings::mSelf = 0;
00029 static KStaticDeleter<GlobalSettings> staticGlobalSettingsDeleter;
00030
00031 GlobalSettings *GlobalSettings::self()
00032 {
00033 if ( !mSelf ) {
00034 staticGlobalSettingsDeleter.setObject( mSelf, new GlobalSettings() );
00035 mSelf->readConfig();
00036 }
00037
00038 return mSelf;
00039 }
00040
00041 GlobalSettings::GlobalSettings()
00042 {
00043 mConfigSyncTimer = new QTimer( this );
00044 connect( mConfigSyncTimer, SIGNAL( timeout() ), this, SLOT( slotSyncNow() ) );
00045 }
00046
00047 void GlobalSettings::requestSync()
00048 {
00049 if ( !mConfigSyncTimer->isActive() )
00050 mConfigSyncTimer->start( 0, true );
00051 }
00052
00053 void GlobalSettings::slotSyncNow()
00054 {
00055 config()->sync();
00056 }
00057
00058 GlobalSettings::~GlobalSettings()
00059 {
00060 }
00061
00062 #include "globalsettings.moc"
|