summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abconfig.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abconfig.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/abconfig.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp
index e58fa76..0b61614 100644
--- a/core/pim/addressbook/abconfig.cpp
+++ b/core/pim/addressbook/abconfig.cpp
@@ -2,24 +2,25 @@
2#include "version.h" 2#include "version.h"
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/recordfields.h> 5#include <qpe/recordfields.h>
6 6
7AbConfig::AbConfig( ): 7AbConfig::AbConfig( ):
8 m_useQtMail( true ), 8 m_useQtMail( true ),
9 m_useOpieMail( false ), 9 m_useOpieMail( false ),
10 m_useRegExp( false ), 10 m_useRegExp( false ),
11 m_beCaseSensitive( false ), 11 m_beCaseSensitive( false ),
12 m_fontSize( 1 ), 12 m_fontSize( 1 ),
13 m_barPos( QMainWindow::Top ), 13 m_barPos( QMainWindow::Top ),
14 m_fixedBars( true ),
14 m_changed( false ) 15 m_changed( false )
15{ 16{
16} 17}
17 18
18AbConfig::~AbConfig() 19AbConfig::~AbConfig()
19{ 20{
20} 21}
21 22
22bool AbConfig::useRegExp() const 23bool AbConfig::useRegExp() const
23{ 24{
24 return m_useRegExp; 25 return m_useRegExp;
25} 26}
@@ -45,24 +46,28 @@ int AbConfig::fontSize() const
45} 46}
46 47
47QValueList<int> AbConfig::orderList() const 48QValueList<int> AbConfig::orderList() const
48{ 49{
49 return m_ordered; 50 return m_ordered;
50} 51}
51 52
52QMainWindow::ToolBarDock AbConfig::getToolBarPos() const 53QMainWindow::ToolBarDock AbConfig::getToolBarPos() const
53{ 54{
54 return (QMainWindow::ToolBarDock) m_barPos; 55 return (QMainWindow::ToolBarDock) m_barPos;
55} 56}
56 57
58bool AbConfig::fixedBars() const
59{
60 return m_fixedBars;
61}
57 62
58void AbConfig::setUseRegExp( bool v ) 63void AbConfig::setUseRegExp( bool v )
59{ 64{
60 m_useRegExp = v ; 65 m_useRegExp = v ;
61 m_changed = true; 66 m_changed = true;
62} 67}
63void AbConfig::setUseWildCards( bool v ) 68void AbConfig::setUseWildCards( bool v )
64{ 69{
65 m_useRegExp = !v; 70 m_useRegExp = !v;
66 m_changed = true; 71 m_changed = true;
67} 72}
68void AbConfig::setBeCaseSensitive( bool v ) 73void AbConfig::setBeCaseSensitive( bool v )
@@ -89,24 +94,30 @@ void AbConfig::setFontSize( int v )
89void AbConfig::setOrderList( const QValueList<int>& list ) 94void AbConfig::setOrderList( const QValueList<int>& list )
90{ 95{
91 m_ordered = list; 96 m_ordered = list;
92 m_changed = true; 97 m_changed = true;
93} 98}
94 99
95void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) 100void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v )
96{ 101{
97 m_barPos = v; 102 m_barPos = v;
98 m_changed = true; 103 m_changed = true;
99} 104}
100 105
106void AbConfig::setFixedBars( const bool fixed )
107{
108 m_fixedBars = fixed;
109 m_changed = true;
110}
111
101void AbConfig::load() 112void AbConfig::load()
102{ 113{
103 // Read Config settings 114 // Read Config settings
104 Config cfg("AddressBook"); 115 Config cfg("AddressBook");
105 116
106 cfg.setGroup("Font"); 117 cfg.setGroup("Font");
107 m_fontSize = cfg.readNumEntry( "fontSize", 1 ); 118 m_fontSize = cfg.readNumEntry( "fontSize", 1 );
108 119
109 cfg.setGroup("Search"); 120 cfg.setGroup("Search");
110 m_useRegExp = cfg.readBoolEntry( "useRegExp" ); 121 m_useRegExp = cfg.readBoolEntry( "useRegExp" );
111 m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive" ); 122 m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive" );
112 123
@@ -124,24 +135,25 @@ void AbConfig::load()
124 } 135 }
125 136
126 // If no contact order is defined, we set the default 137 // If no contact order is defined, we set the default
127 if ( m_ordered.count() == 0 ) { 138 if ( m_ordered.count() == 0 ) {
128 m_ordered.append( Qtopia::DefaultEmail ); 139 m_ordered.append( Qtopia::DefaultEmail );
129 m_ordered.append( Qtopia::HomePhone); 140 m_ordered.append( Qtopia::HomePhone);
130 m_ordered.append( Qtopia::HomeMobile); 141 m_ordered.append( Qtopia::HomeMobile);
131 m_ordered.append( Qtopia::BusinessPhone); 142 m_ordered.append( Qtopia::BusinessPhone);
132 } 143 }
133 144
134 cfg.setGroup("ToolBar"); 145 cfg.setGroup("ToolBar");
135 m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); 146 m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top );
147 m_fixedBars= cfg.readBoolEntry( "fixedBars", true );
136 148
137 m_changed = false; 149 m_changed = false;
138} 150}
139 151
140void AbConfig::save() 152void AbConfig::save()
141{ 153{
142 if ( m_changed ){ 154 if ( m_changed ){
143 Config cfg("AddressBook"); 155 Config cfg("AddressBook");
144 cfg.setGroup("Font"); 156 cfg.setGroup("Font");
145 cfg.writeEntry("fontSize", m_fontSize); 157 cfg.writeEntry("fontSize", m_fontSize);
146 158
147 cfg.setGroup("Search"); 159 cfg.setGroup("Search");
@@ -151,34 +163,36 @@ void AbConfig::save()
151 cfg.setGroup("Mail"); 163 cfg.setGroup("Mail");
152 cfg.writeEntry( "useQtMail", m_useQtMail ); 164 cfg.writeEntry( "useQtMail", m_useQtMail );
153 cfg.writeEntry( "useOpieMail", m_useOpieMail); 165 cfg.writeEntry( "useOpieMail", m_useOpieMail);
154 166
155 cfg.setGroup("ContactOrder"); 167 cfg.setGroup("ContactOrder");
156 cfg.clearGroup(); 168 cfg.clearGroup();
157 for ( uint i = 0; i < m_ordered.count(); i++ ){ 169 for ( uint i = 0; i < m_ordered.count(); i++ ){
158 cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); 170 cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] );
159 } 171 }
160 172
161 cfg.setGroup("ToolBar"); 173 cfg.setGroup("ToolBar");
162 cfg.writeEntry( "Position", m_barPos ); 174 cfg.writeEntry( "Position", m_barPos );
175 cfg.writeEntry( "fixedBars", m_fixedBars );
163 176
164 cfg.setGroup("Version"); 177 cfg.setGroup("Version");
165 cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); 178 cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION);
166 cfg.writeEntry( "Mainversion", MAINVERSION ); 179 cfg.writeEntry( "Mainversion", MAINVERSION );
167 cfg.writeEntry( "SubVersion", SUBVERSION ); 180 cfg.writeEntry( "SubVersion", SUBVERSION );
168 cfg.writeEntry( "PatchVersion", PATCHVERSION ); 181 cfg.writeEntry( "PatchVersion", PATCHVERSION );
169 182
170 } 183 }
171 184
172} 185}
173 186
174void AbConfig::operator= ( const AbConfig& cnf ) 187void AbConfig::operator= ( const AbConfig& cnf )
175{ 188{
176 m_useQtMail = cnf.m_useQtMail; 189 m_useQtMail = cnf.m_useQtMail;
177 m_useOpieMail = cnf.m_useOpieMail; 190 m_useOpieMail = cnf.m_useOpieMail;
178 m_useRegExp = cnf.m_useRegExp; 191 m_useRegExp = cnf.m_useRegExp;
179 m_beCaseSensitive = cnf.m_beCaseSensitive; 192 m_beCaseSensitive = cnf.m_beCaseSensitive;
180 m_fontSize = cnf.m_fontSize; 193 m_fontSize = cnf.m_fontSize;
181 m_ordered = cnf.m_ordered; 194 m_ordered = cnf.m_ordered;
182 m_barPos = cnf.m_barPos; 195 m_barPos = cnf.m_barPos;
196 m_fixedBars = cnf.m_fixedBars;
183} 197}
184 198