knotesglobalconfig.cpp
00001
00002
00003
00004 #include "knotesglobalconfig.h"
00005
00006 #include <kstaticdeleter.h>
00007
00008 KNotesGlobalConfig *KNotesGlobalConfig::mSelf = 0;
00009 static KStaticDeleter<KNotesGlobalConfig> staticDeleter;
00010
00011 KNotesGlobalConfig *KNotesGlobalConfig::self()
00012 {
00013 if ( !mSelf ) {
00014 staticDeleter.setObject( mSelf, new KNotesGlobalConfig() );
00015 mSelf->readConfig();
00016 }
00017
00018 return mSelf;
00019 }
00020
00021 KNotesGlobalConfig::KNotesGlobalConfig( )
00022 : KNoteConfig()
00023 {
00024 mSelf = this;
00025 setCurrentGroup( "Actions" );
00026
00027 KConfigSkeleton::ItemString *itemMailAction;
00028 itemMailAction = new KConfigSkeleton::ItemString( currentGroup(), "MailAction", mMailAction, "kmail --subject %t --body %f" );
00029 addItem( itemMailAction );
00030
00031 setCurrentGroup( "Network" );
00032
00033 KConfigSkeleton::ItemBool *itemReceiveNotes;
00034 itemReceiveNotes = new KConfigSkeleton::ItemBool( currentGroup(), "ReceiveNotes", mReceiveNotes, false );
00035 addItem( itemReceiveNotes );
00036 KConfigSkeleton::ItemUInt *itemPort;
00037 itemPort = new KConfigSkeleton::ItemUInt( currentGroup(), "Port", mPort, 24837 );
00038 addItem( itemPort );
00039 KConfigSkeleton::ItemString *itemSenderID;
00040 itemSenderID = new KConfigSkeleton::ItemString( currentGroup(), "SenderID", mSenderID );
00041 addItem( itemSenderID );
00042 KConfigSkeleton::ItemStringList *itemKnownHosts;
00043 itemKnownHosts = new KConfigSkeleton::ItemStringList( currentGroup(), "KnownHosts", mKnownHosts );
00044 addItem( itemKnownHosts );
00045 }
00046
00047 KNotesGlobalConfig::~KNotesGlobalConfig()
00048 {
00049 if ( mSelf == this )
00050 staticDeleter.setObject( mSelf, 0, false );
00051 }
00052
This file is part of the documentation for knotes Library Version 3.3.0.