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