Diffstat (limited to 'core/pim/addressbook/abconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index 2583327..9cc2668 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp | |||
@@ -1,57 +1,57 @@ | |||
1 | #include "abconfig.h" | 1 | #include "abconfig.h" |
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 | ||
7 | AbConfig::AbConfig( ): | 7 | AbConfig::AbConfig( ): |
8 | m_useQtMail( true ), | 8 | m_useQtMail( false ), |
9 | m_useOpieMail( false ), | 9 | m_useOpieMail( true ), |
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_fixedBars( true ), |
15 | m_lpSearchMode( LastName ), | 15 | m_lpSearchMode( LastName ), |
16 | m_changed( false ) | 16 | m_changed( false ) |
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | AbConfig::~AbConfig() | 20 | AbConfig::~AbConfig() |
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | bool AbConfig::useRegExp() const | 24 | bool AbConfig::useRegExp() const |
25 | { | 25 | { |
26 | return m_useRegExp; | 26 | return m_useRegExp; |
27 | } | 27 | } |
28 | bool AbConfig::useWildCards() const | 28 | bool AbConfig::useWildCards() const |
29 | { | 29 | { |
30 | return !m_useRegExp; | 30 | return !m_useRegExp; |
31 | } | 31 | } |
32 | bool AbConfig::useQtMail() const | 32 | bool AbConfig::useQtMail() const |
33 | { | 33 | { |
34 | return m_useQtMail; | 34 | return m_useQtMail; |
35 | } | 35 | } |
36 | bool AbConfig::useOpieMail() const | 36 | bool AbConfig::useOpieMail() const |
37 | { | 37 | { |
38 | return m_useOpieMail; | 38 | return m_useOpieMail; |
39 | } | 39 | } |
40 | bool AbConfig::beCaseSensitive() const | 40 | bool AbConfig::beCaseSensitive() const |
41 | { | 41 | { |
42 | return m_beCaseSensitive; | 42 | return m_beCaseSensitive; |
43 | } | 43 | } |
44 | int AbConfig::fontSize() const | 44 | int AbConfig::fontSize() const |
45 | { | 45 | { |
46 | return m_fontSize; | 46 | return m_fontSize; |
47 | } | 47 | } |
48 | 48 | ||
49 | QValueList<int> AbConfig::orderList() const | 49 | QValueList<int> AbConfig::orderList() const |
50 | { | 50 | { |
51 | return m_ordered; | 51 | return m_ordered; |
52 | } | 52 | } |
53 | 53 | ||
54 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const | 54 | QMainWindow::ToolBarDock AbConfig::getToolBarPos() const |
55 | { | 55 | { |
56 | return (QMainWindow::ToolBarDock) m_barPos; | 56 | return (QMainWindow::ToolBarDock) m_barPos; |
57 | } | 57 | } |
@@ -103,98 +103,98 @@ void AbConfig::setFontSize( int v ) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | void AbConfig::setOrderList( const QValueList<int>& list ) | 105 | void AbConfig::setOrderList( const QValueList<int>& list ) |
106 | { | 106 | { |
107 | m_ordered = list; | 107 | m_ordered = list; |
108 | m_changed = true; | 108 | m_changed = true; |
109 | } | 109 | } |
110 | 110 | ||
111 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) | 111 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) |
112 | { | 112 | { |
113 | m_barPos = v; | 113 | m_barPos = v; |
114 | m_changed = true; | 114 | m_changed = true; |
115 | } | 115 | } |
116 | 116 | ||
117 | void AbConfig::setFixedBars( const bool fixed ) | 117 | void AbConfig::setFixedBars( const bool fixed ) |
118 | { | 118 | { |
119 | m_fixedBars = fixed; | 119 | m_fixedBars = fixed; |
120 | m_changed = true; | 120 | m_changed = true; |
121 | } | 121 | } |
122 | 122 | ||
123 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) | 123 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) |
124 | { | 124 | { |
125 | m_lpSearchMode = mode; | 125 | m_lpSearchMode = mode; |
126 | m_changed = true; | 126 | m_changed = true; |
127 | } | 127 | } |
128 | 128 | ||
129 | void AbConfig::setCategory( const QString &cat ) | 129 | void AbConfig::setCategory( const QString &cat ) |
130 | { | 130 | { |
131 | m_category = cat; | 131 | m_category = cat; |
132 | } | 132 | } |
133 | 133 | ||
134 | void AbConfig::load() | 134 | void AbConfig::load() |
135 | { | 135 | { |
136 | // Read Config settings | 136 | // Read Config settings |
137 | Config cfg("AddressBook"); | 137 | Config cfg("AddressBook"); |
138 | 138 | ||
139 | cfg.setGroup( "View" ); | 139 | cfg.setGroup( "View" ); |
140 | m_category = cfg.readEntry( "Category", "All" ); | 140 | m_category = cfg.readEntry( "Category", "All" ); |
141 | 141 | ||
142 | cfg.setGroup("Font"); | 142 | cfg.setGroup("Font"); |
143 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); | 143 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); |
144 | 144 | ||
145 | cfg.setGroup("Search"); | 145 | cfg.setGroup("Search"); |
146 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); | 146 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); |
147 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); | 147 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); |
148 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FileAs ); | 148 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FileAs ); |
149 | 149 | ||
150 | cfg.setGroup("Mail"); | 150 | cfg.setGroup("Mail"); |
151 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); | 151 | m_useQtMail = cfg.readBoolEntry( "useQtMail", false ); |
152 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 152 | m_useOpieMail = cfg.readBoolEntry( "useOpieMail", true ); |
153 | 153 | ||
154 | cfg.setGroup("ContactOrder"); | 154 | cfg.setGroup("ContactOrder"); |
155 | int ID = 0; | 155 | int ID = 0; |
156 | int i = 0; | 156 | int i = 0; |
157 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 157 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
158 | while ( ID != 0 ){ | 158 | while ( ID != 0 ){ |
159 | m_ordered.append( ID ); | 159 | m_ordered.append( ID ); |
160 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 160 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
161 | } | 161 | } |
162 | 162 | ||
163 | // If no contact order is defined, we set the default | 163 | // If no contact order is defined, we set the default |
164 | if ( m_ordered.count() == 0 ) { | 164 | if ( m_ordered.count() == 0 ) { |
165 | m_ordered.append( Qtopia::DefaultEmail ); | 165 | m_ordered.append( Qtopia::DefaultEmail ); |
166 | m_ordered.append( Qtopia::HomePhone); | 166 | m_ordered.append( Qtopia::HomePhone); |
167 | m_ordered.append( Qtopia::HomeMobile); | 167 | m_ordered.append( Qtopia::HomeMobile); |
168 | m_ordered.append( Qtopia::BusinessPhone); | 168 | m_ordered.append( Qtopia::BusinessPhone); |
169 | } | 169 | } |
170 | 170 | ||
171 | cfg.setGroup("ToolBar"); | 171 | cfg.setGroup("ToolBar"); |
172 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); | 172 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); |
173 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); | 173 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); |
174 | 174 | ||
175 | m_changed = false; | 175 | m_changed = false; |
176 | } | 176 | } |
177 | 177 | ||
178 | void AbConfig::save() | 178 | void AbConfig::save() |
179 | { | 179 | { |
180 | if ( m_changed ){ | 180 | if ( m_changed ){ |
181 | Config cfg("AddressBook"); | 181 | Config cfg("AddressBook"); |
182 | cfg.setGroup( "View" ); | 182 | cfg.setGroup( "View" ); |
183 | cfg.writeEntry( "Category", m_category ); | 183 | cfg.writeEntry( "Category", m_category ); |
184 | 184 | ||
185 | cfg.setGroup("Font"); | 185 | cfg.setGroup("Font"); |
186 | cfg.writeEntry("fontSize", m_fontSize); | 186 | cfg.writeEntry("fontSize", m_fontSize); |
187 | 187 | ||
188 | cfg.setGroup("Search"); | 188 | cfg.setGroup("Search"); |
189 | cfg.writeEntry("useRegExp", m_useRegExp); | 189 | cfg.writeEntry("useRegExp", m_useRegExp); |
190 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 190 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
191 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | 191 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); |
192 | 192 | ||
193 | cfg.setGroup("Mail"); | 193 | cfg.setGroup("Mail"); |
194 | cfg.writeEntry( "useQtMail", m_useQtMail ); | 194 | cfg.writeEntry( "useQtMail", m_useQtMail ); |
195 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | 195 | cfg.writeEntry( "useOpieMail", m_useOpieMail); |
196 | 196 | ||
197 | cfg.setGroup("ContactOrder"); | 197 | cfg.setGroup("ContactOrder"); |
198 | cfg.clearGroup(); | 198 | cfg.clearGroup(); |
199 | for ( uint i = 0; i < m_ordered.count(); i++ ){ | 199 | for ( uint i = 0; i < m_ordered.count(); i++ ){ |
200 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); | 200 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); |