prefs.cpp

Go to the documentation of this file.
00001 // This file is generated by kconfig_compiler from kwin4.kcfg.
00002 // All changes you do to this file will be lost.
00003 
00004 #include "prefs.h"
00005 
00006 #include <kstaticdeleter.h>
00007 
00008 Prefs *Prefs::mSelf = 0;
00009 static KStaticDeleter<Prefs> staticPrefsDeleter;
00010 
00011 Prefs *Prefs::self()
00012 {
00013   if ( !mSelf ) {
00014     staticPrefsDeleter.setObject( mSelf, new Prefs() );
00015     mSelf->readConfig();
00016   }
00017 
00018   return mSelf;
00019 }
00020 
00021 Prefs::Prefs(  )
00022   : KConfigSkeleton( QLatin1String( "kwin4rc" ) )
00023 {
00024   mSelf = this;
00025   setCurrentGroup( QLatin1String( "Parameter" ) );
00026 
00027   KConfigSkeleton::ItemInt  *itemPort;
00028   itemPort = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "port" ), mPort, 7442 );
00029   addItem( itemPort, QLatin1String( "port" ) );
00030   KConfigSkeleton::ItemString  *itemGamename;
00031   itemGamename = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "gamename" ), mGamename );
00032   addItem( itemGamename, QLatin1String( "gamename" ) );
00033   KConfigSkeleton::ItemString  *itemHost;
00034   itemHost = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "host" ), mHost, QLatin1String( "localhost" ) );
00035   addItem( itemHost, QLatin1String( "host" ) );
00036   KConfigSkeleton::ItemInt  *itemLevel;
00037   itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "level" ), mLevel, 3 );
00038   itemLevel->setMinValue(0);
00039   itemLevel->setMaxValue(5);
00040   addItem( itemLevel, QLatin1String( "level" ) );
00041   KConfigSkeleton::ItemString  *itemName1;
00042   itemName1 = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Name1" ), mName1, QLatin1String( "Player 1" ) );
00043   addItem( itemName1, QLatin1String( "Name1" ) );
00044   KConfigSkeleton::ItemString  *itemName2;
00045   itemName2 = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Name2" ), mName2, QLatin1String( "Player 2" ) );
00046   addItem( itemName2, QLatin1String( "Name2" ) );
00047   KConfigSkeleton::ItemInt  *itemInput1;
00048   itemInput1 = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Input1" ), mInput1, 0 );
00049   addItem( itemInput1, QLatin1String( "Input1" ) );
00050   KConfigSkeleton::ItemInt  *itemInput2;
00051   itemInput2 = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Input2" ), mInput2, 0 );
00052   addItem( itemInput2, QLatin1String( "Input2" ) );
00053   KConfigSkeleton::ItemInt  *itemColour1;
00054   itemColour1 = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Colour1" ), mColour1, 0 );
00055   addItem( itemColour1, QLatin1String( "Colour1" ) );
00056 }
00057 
00058 Prefs::~Prefs()
00059 {
00060   if ( mSelf == this )
00061     staticPrefsDeleter.setObject( mSelf, 0, false );
00062 }
00063 

Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6