summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abconfig.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp
index a3fd222..2583327 100644
--- a/core/pim/addressbook/abconfig.cpp
+++ b/core/pim/addressbook/abconfig.cpp
@@ -16,13 +16,13 @@ AbConfig::AbConfig( ):
16 m_changed( false ) 16 m_changed( false )
17{ 17{
18} 18}
19 19
20AbConfig::~AbConfig() 20AbConfig::~AbConfig()
21{ 21{
22} 22}
23 23
24bool AbConfig::useRegExp() const 24bool AbConfig::useRegExp() const
25{ 25{
26 return m_useRegExp; 26 return m_useRegExp;
27} 27}
28bool AbConfig::useWildCards() const 28bool AbConfig::useWildCards() const
@@ -63,12 +63,17 @@ bool AbConfig::fixedBars() const
63 63
64AbConfig::LPSearchMode AbConfig::letterPickerSearch() const 64AbConfig::LPSearchMode AbConfig::letterPickerSearch() const
65{ 65{
66 return ( AbConfig::LPSearchMode ) m_lpSearchMode; 66 return ( AbConfig::LPSearchMode ) m_lpSearchMode;
67} 67}
68 68
69const QString &AbConfig::category() const
70{
71 return m_category;
72}
73
69void AbConfig::setUseRegExp( bool v ) 74void AbConfig::setUseRegExp( bool v )
70{ 75{
71 m_useRegExp = v ; 76 m_useRegExp = v ;
72 m_changed = true; 77 m_changed = true;
73} 78}
74void AbConfig::setUseWildCards( bool v ) 79void AbConfig::setUseWildCards( bool v )
@@ -118,17 +123,25 @@ void AbConfig::setFixedBars( const bool fixed )
118void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) 123void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode )
119{ 124{
120 m_lpSearchMode = mode; 125 m_lpSearchMode = mode;
121 m_changed = true; 126 m_changed = true;
122} 127}
123 128
129void AbConfig::setCategory( const QString &cat )
130{
131 m_category = cat;
132}
133
124void AbConfig::load() 134void AbConfig::load()
125{ 135{
126 // Read Config settings 136 // Read Config settings
127 Config cfg("AddressBook"); 137 Config cfg("AddressBook");
128 138
139 cfg.setGroup( "View" );
140 m_category = cfg.readEntry( "Category", "All" );
141
129 cfg.setGroup("Font"); 142 cfg.setGroup("Font");
130 m_fontSize = cfg.readNumEntry( "fontSize", 1 ); 143 m_fontSize = cfg.readNumEntry( "fontSize", 1 );
131 144
132 cfg.setGroup("Search"); 145 cfg.setGroup("Search");
133 m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); 146 m_useRegExp = cfg.readBoolEntry( "useRegExp", false );
134 m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); 147 m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false );
@@ -163,12 +176,15 @@ void AbConfig::load()
163} 176}
164 177
165void AbConfig::save() 178void AbConfig::save()
166{ 179{
167 if ( m_changed ){ 180 if ( m_changed ){
168 Config cfg("AddressBook"); 181 Config cfg("AddressBook");
182 cfg.setGroup( "View" );
183 cfg.writeEntry( "Category", m_category );
184
169 cfg.setGroup("Font"); 185 cfg.setGroup("Font");
170 cfg.writeEntry("fontSize", m_fontSize); 186 cfg.writeEntry("fontSize", m_fontSize);
171 187
172 cfg.setGroup("Search"); 188 cfg.setGroup("Search");
173 cfg.writeEntry("useRegExp", m_useRegExp); 189 cfg.writeEntry("useRegExp", m_useRegExp);
174 cfg.writeEntry("caseSensitive", m_beCaseSensitive); 190 cfg.writeEntry("caseSensitive", m_beCaseSensitive);
@@ -190,15 +206,15 @@ void AbConfig::save()
190 206
191 cfg.setGroup("Version"); 207 cfg.setGroup("Version");
192 cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); 208 cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION);
193 cfg.writeEntry( "Mainversion", MAINVERSION ); 209 cfg.writeEntry( "Mainversion", MAINVERSION );
194 cfg.writeEntry( "SubVersion", SUBVERSION ); 210 cfg.writeEntry( "SubVersion", SUBVERSION );
195 cfg.writeEntry( "PatchVersion", PATCHVERSION ); 211 cfg.writeEntry( "PatchVersion", PATCHVERSION );
196 212
197 } 213 }
198 214
199} 215}
200 216
201void AbConfig::operator= ( const AbConfig& cnf ) 217void AbConfig::operator= ( const AbConfig& cnf )
202{ 218{
203 m_useQtMail = cnf.m_useQtMail; 219 m_useQtMail = cnf.m_useQtMail;
204 m_useOpieMail = cnf.m_useOpieMail; 220 m_useOpieMail = cnf.m_useOpieMail;