libkdepim Library API Documentation

prefs.cpp

00001 
00022 #include "prefs.h"
00023 
00024 #include <kconfig.h>
00025 #include <kdebug.h>
00026 #include <kglobal.h>
00027 #include <klocale.h>
00028 #include <kstaticdeleter.h>
00029 
00030 using namespace Komposer;
00031 
00032 Prefs *Prefs::s_instance = 0;
00033 
00034 static KStaticDeleter<Prefs> insd;
00035 
00036 
00037 Prefs::Prefs()
00038   : KPrefs( "komposerrc" )
00039 {
00040   KPrefs::setCurrentGroup( "View" );
00041 
00042   addItemString( "ActiveEditor", m_activeEditor, "krichtext" );
00043 
00044   QStringList defaultEditors;
00045   defaultEditors << "krichtext";
00046   addItemStringList( "ActiveEditors", m_activeEditors, defaultEditors );
00047 }
00048 
00049 Prefs::~Prefs()
00050 {
00051   if ( s_instance == this )
00052     s_instance = insd.setObject( 0 );
00053 }
00054 
00055 Prefs *Prefs::self()
00056 {
00057   if ( !s_instance ) {
00058     insd.setObject( s_instance, new Prefs() );
00059     s_instance->readConfig();
00060   }
00061 
00062   return s_instance;
00063 }
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:31 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003