summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabprefs.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabprefs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 3cbcc9a..db123da 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -22,96 +22,101 @@
22*/ 22*/
23 23
24//US#ifdef KAB_EMBEDDED 24//US#ifdef KAB_EMBEDDED
25//#include <qstring.h> 25//#include <qstring.h>
26//#endif //KAB_EMBEDDED 26//#endif //KAB_EMBEDDED
27 27
28#include <qtextstream.h> 28#include <qtextstream.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qregexp.h> 30#include <qregexp.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37//US#include <kdebug.h> // defines kdDebug() 37//US#include <kdebug.h> // defines kdDebug()
38 38
39#include "kabprefs.h" 39#include "kabprefs.h"
40 40
41#ifdef DESKTOP_VERSION 41#ifdef DESKTOP_VERSION
42#include <qapplication.h> 42#include <qapplication.h>
43#endif 43#endif
44 44
45KABPrefs *KABPrefs::sInstance = 0; 45KABPrefs *KABPrefs::sInstance = 0;
46static KStaticDeleter<KABPrefs> staticDeleterAB; 46static KStaticDeleter<KABPrefs> staticDeleterAB;
47 47
48KABPrefs::KABPrefs() 48KABPrefs::KABPrefs()
49 : KPimPrefs("kaddressbookrc") 49 : KPimPrefs("kaddressbookrc")
50{ 50{
51 mDetailsFont = QFont("helvetica",12); 51 mDetailsFont = QFont("helvetica",12);
52 KPrefs::setCurrentGroup( "Views" ); 52 KPrefs::setCurrentGroup( "Views" );
53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
54 54
55 KPrefs::setCurrentGroup( "General" ); 55 KPrefs::setCurrentGroup( "General" );
56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
58 58
59#ifdef KAB_EMBEDDED 59#ifdef KAB_EMBEDDED
60 addItemBool("AskForQuit",&mAskForQuit,true); 60 addItemBool("AskForQuit",&mAskForQuit,true);
61 addItemBool("ToolBarHor",&mToolBarHor, true ); 61 addItemBool("ToolBarHor",&mToolBarHor, true );
62 addItemBool("ToolBarUp",&mToolBarUp, false ); 62 addItemBool("ToolBarUp",&mToolBarUp, false );
63 addItemBool("SearchWithReturn",&mSearchWithReturn, true ); 63 addItemBool("SearchWithReturn",&mSearchWithReturn, true );
64 addItemFont("DetailsFont",&mDetailsFont); 64 addItemFont("DetailsFont",&mDetailsFont);
65 65
66 66
67#endif //KAB_EMBEDDED 67#endif //KAB_EMBEDDED
68 68
69 KPrefs::setCurrentGroup( "MainWindow" ); 69 KPrefs::setCurrentGroup( "MainWindow" );
70 bool m_visible = false;
71#ifdef DESKTOP_VERSION
72 m_visible = true;
73#endif
74 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
70 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 75 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
71 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 76 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
72 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 77 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
73 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 78 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
74 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 79 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
75 80
76 81
77 KPrefs::setCurrentGroup( "Extensions_General" ); 82 KPrefs::setCurrentGroup( "Extensions_General" );
78 QStringList defaultExtensions; 83 QStringList defaultExtensions;
79 defaultExtensions << "merge"; 84 defaultExtensions << "merge";
80 defaultExtensions << "distribution_list_editor"; 85 defaultExtensions << "distribution_list_editor";
81 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 86 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
82 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 87 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
83 88
84 KPrefs::setCurrentGroup( "Views" ); 89 KPrefs::setCurrentGroup( "Views" );
85 QString defaultView = i18n( "Default Table View" ); 90 QString defaultView = i18n( "Default Table View" );
86 addItemString( "CurrentView", &mCurrentView, defaultView ); 91 addItemString( "CurrentView", &mCurrentView, defaultView );
87 addItemStringList( "ViewNames", &mViewNames, defaultView ); 92 addItemStringList( "ViewNames", &mViewNames, defaultView );
88 93
89 KPrefs::setCurrentGroup( "Filters" ); 94 KPrefs::setCurrentGroup( "Filters" );
90 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 95 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
91 96
92} 97}
93 98
94KABPrefs::~KABPrefs() 99KABPrefs::~KABPrefs()
95{ 100{
96 //qDebug("KABPrefs::~KABPrefs() "); 101 //qDebug("KABPrefs::~KABPrefs() ");
97 if (sInstance == this) 102 if (sInstance == this)
98 sInstance = staticDeleterAB.setObject(0); 103 sInstance = staticDeleterAB.setObject(0);
99} 104}
100 105
101KABPrefs *KABPrefs::instance() 106KABPrefs *KABPrefs::instance()
102{ 107{
103 if ( !sInstance ) { 108 if ( !sInstance ) {
104#ifdef KAB_EMBEDDED 109#ifdef KAB_EMBEDDED
105 sInstance = staticDeleterAB.setObject( new KABPrefs() ); 110 sInstance = staticDeleterAB.setObject( new KABPrefs() );
106#else //KAB_EMBEDDED 111#else //KAB_EMBEDDED
107 //US the following line has changed ???. Why 112 //US the following line has changed ???. Why
108 staticDeleterAB.setObject( sInstance, new KABPrefs() ); 113 staticDeleterAB.setObject( sInstance, new KABPrefs() );
109#endif //KAB_EMBEDDED 114#endif //KAB_EMBEDDED
110 sInstance->readConfig(); 115 sInstance->readConfig();
111 } 116 }
112 117
113 return sInstance; 118 return sInstance;
114} 119}
115 120
116void KABPrefs::setCategoryDefaults() 121void KABPrefs::setCategoryDefaults()
117{ 122{