24 #include <tdeconfig.h>
25 #include <tdelocale.h>
26 #include <kstaticdeleter.h>
30 KABPrefs *KABPrefs::mInstance = 0;
31 static KStaticDeleter<KABPrefs> staticDeleter;
36 TDEConfigSkeleton::setCurrentGroup( "General" );
38 TQStringList defaultMap;
39 defaultMap << "http://maps.google.com/maps?f=q&hl=%1&q=%n,%l,%s";
40 addItemString( "LocationMapURL", mLocationMapURL, defaultMap[ 0 ] );
41 addItemStringList( "LocationMapURLs", mLocationMapURLs, defaultMap );
48 KABPrefs *KABPrefs::instance()
51 staticDeleter.setObject( mInstance, new KABPrefs() );
52 mInstance->readConfig();
58 void KABPrefs::setCategoryDefaults()
60 mCustomCategories.clear();
61 mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" )
62 << i18n( "Customer" ) << i18n( "Friend" );
65 void KABPrefs::usrReadConfig()
67 config()->setGroup( "General" );
68 mCustomCategories = config()->readListEntry( "Custom Categories" );
69 if ( mCustomCategories.isEmpty() )
70 setCategoryDefaults();
72 KPimPrefs::usrReadConfig();
76 void KABPrefs::usrWriteConfig()
78 config()->setGroup( "General" );
79 config()->writeEntry( "Custom Categories", mCustomCategories );
81 KPimPrefs::usrWriteConfig();
|