-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 2 | ||||
-rw-r--r-- | core/pim/addressbook/abconfig.h | 2 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index 4a0875b..a3fd222 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp | |||
@@ -39,175 +39,175 @@ bool AbConfig::useOpieMail() const | |||
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 | } |
58 | 58 | ||
59 | bool AbConfig::fixedBars() const | 59 | bool AbConfig::fixedBars() const |
60 | { | 60 | { |
61 | return m_fixedBars; | 61 | return m_fixedBars; |
62 | } | 62 | } |
63 | 63 | ||
64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const | 64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const |
65 | { | 65 | { |
66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; | 66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; |
67 | } | 67 | } |
68 | 68 | ||
69 | void AbConfig::setUseRegExp( bool v ) | 69 | void AbConfig::setUseRegExp( bool v ) |
70 | { | 70 | { |
71 | m_useRegExp = v ; | 71 | m_useRegExp = v ; |
72 | m_changed = true; | 72 | m_changed = true; |
73 | } | 73 | } |
74 | void AbConfig::setUseWildCards( bool v ) | 74 | void AbConfig::setUseWildCards( bool v ) |
75 | { | 75 | { |
76 | m_useRegExp = !v; | 76 | m_useRegExp = !v; |
77 | m_changed = true; | 77 | m_changed = true; |
78 | } | 78 | } |
79 | void AbConfig::setBeCaseSensitive( bool v ) | 79 | void AbConfig::setBeCaseSensitive( bool v ) |
80 | { | 80 | { |
81 | m_beCaseSensitive = v; | 81 | m_beCaseSensitive = v; |
82 | m_changed = true; | 82 | m_changed = true; |
83 | } | 83 | } |
84 | void AbConfig::setUseQtMail( bool v ) | 84 | void AbConfig::setUseQtMail( bool v ) |
85 | { | 85 | { |
86 | m_useQtMail = v; | 86 | m_useQtMail = v; |
87 | m_changed = true; | 87 | m_changed = true; |
88 | } | 88 | } |
89 | void AbConfig::setUseOpieMail( bool v ) | 89 | void AbConfig::setUseOpieMail( bool v ) |
90 | { | 90 | { |
91 | m_useOpieMail = v; | 91 | m_useOpieMail = v; |
92 | m_changed = true; | 92 | m_changed = true; |
93 | } | 93 | } |
94 | void AbConfig::setFontSize( int v ) | 94 | void AbConfig::setFontSize( int v ) |
95 | { | 95 | { |
96 | m_fontSize = v; | 96 | m_fontSize = v; |
97 | m_changed = true; | 97 | m_changed = true; |
98 | } | 98 | } |
99 | 99 | ||
100 | void AbConfig::setOrderList( const QValueList<int>& list ) | 100 | void AbConfig::setOrderList( const QValueList<int>& list ) |
101 | { | 101 | { |
102 | m_ordered = list; | 102 | m_ordered = list; |
103 | m_changed = true; | 103 | m_changed = true; |
104 | } | 104 | } |
105 | 105 | ||
106 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) | 106 | void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) |
107 | { | 107 | { |
108 | m_barPos = v; | 108 | m_barPos = v; |
109 | m_changed = true; | 109 | m_changed = true; |
110 | } | 110 | } |
111 | 111 | ||
112 | void AbConfig::setFixedBars( const bool fixed ) | 112 | void AbConfig::setFixedBars( const bool fixed ) |
113 | { | 113 | { |
114 | m_fixedBars = fixed; | 114 | m_fixedBars = fixed; |
115 | m_changed = true; | 115 | m_changed = true; |
116 | } | 116 | } |
117 | 117 | ||
118 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) | 118 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) |
119 | { | 119 | { |
120 | m_lpSearchMode = mode; | 120 | m_lpSearchMode = mode; |
121 | m_changed = true; | 121 | m_changed = true; |
122 | } | 122 | } |
123 | 123 | ||
124 | void AbConfig::load() | 124 | void AbConfig::load() |
125 | { | 125 | { |
126 | // Read Config settings | 126 | // Read Config settings |
127 | Config cfg("AddressBook"); | 127 | Config cfg("AddressBook"); |
128 | 128 | ||
129 | cfg.setGroup("Font"); | 129 | cfg.setGroup("Font"); |
130 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); | 130 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); |
131 | 131 | ||
132 | cfg.setGroup("Search"); | 132 | cfg.setGroup("Search"); |
133 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); | 133 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); |
134 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); | 134 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); |
135 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FullName ); | 135 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FileAs ); |
136 | 136 | ||
137 | cfg.setGroup("Mail"); | 137 | cfg.setGroup("Mail"); |
138 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); | 138 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); |
139 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 139 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); |
140 | 140 | ||
141 | cfg.setGroup("ContactOrder"); | 141 | cfg.setGroup("ContactOrder"); |
142 | int ID = 0; | 142 | int ID = 0; |
143 | int i = 0; | 143 | int i = 0; |
144 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 144 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
145 | while ( ID != 0 ){ | 145 | while ( ID != 0 ){ |
146 | m_ordered.append( ID ); | 146 | m_ordered.append( ID ); |
147 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); | 147 | ID = cfg.readNumEntry( "ContactID_"+QString::number(i++), 0 ); |
148 | } | 148 | } |
149 | 149 | ||
150 | // If no contact order is defined, we set the default | 150 | // If no contact order is defined, we set the default |
151 | if ( m_ordered.count() == 0 ) { | 151 | if ( m_ordered.count() == 0 ) { |
152 | m_ordered.append( Qtopia::DefaultEmail ); | 152 | m_ordered.append( Qtopia::DefaultEmail ); |
153 | m_ordered.append( Qtopia::HomePhone); | 153 | m_ordered.append( Qtopia::HomePhone); |
154 | m_ordered.append( Qtopia::HomeMobile); | 154 | m_ordered.append( Qtopia::HomeMobile); |
155 | m_ordered.append( Qtopia::BusinessPhone); | 155 | m_ordered.append( Qtopia::BusinessPhone); |
156 | } | 156 | } |
157 | 157 | ||
158 | cfg.setGroup("ToolBar"); | 158 | cfg.setGroup("ToolBar"); |
159 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); | 159 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); |
160 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); | 160 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); |
161 | 161 | ||
162 | m_changed = false; | 162 | m_changed = false; |
163 | } | 163 | } |
164 | 164 | ||
165 | void AbConfig::save() | 165 | void AbConfig::save() |
166 | { | 166 | { |
167 | if ( m_changed ){ | 167 | if ( m_changed ){ |
168 | Config cfg("AddressBook"); | 168 | Config cfg("AddressBook"); |
169 | cfg.setGroup("Font"); | 169 | cfg.setGroup("Font"); |
170 | cfg.writeEntry("fontSize", m_fontSize); | 170 | cfg.writeEntry("fontSize", m_fontSize); |
171 | 171 | ||
172 | cfg.setGroup("Search"); | 172 | cfg.setGroup("Search"); |
173 | cfg.writeEntry("useRegExp", m_useRegExp); | 173 | cfg.writeEntry("useRegExp", m_useRegExp); |
174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | 175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); |
176 | 176 | ||
177 | cfg.setGroup("Mail"); | 177 | cfg.setGroup("Mail"); |
178 | cfg.writeEntry( "useQtMail", m_useQtMail ); | 178 | cfg.writeEntry( "useQtMail", m_useQtMail ); |
179 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | 179 | cfg.writeEntry( "useOpieMail", m_useOpieMail); |
180 | 180 | ||
181 | cfg.setGroup("ContactOrder"); | 181 | cfg.setGroup("ContactOrder"); |
182 | cfg.clearGroup(); | 182 | cfg.clearGroup(); |
183 | for ( uint i = 0; i < m_ordered.count(); i++ ){ | 183 | for ( uint i = 0; i < m_ordered.count(); i++ ){ |
184 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); | 184 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); |
185 | } | 185 | } |
186 | 186 | ||
187 | cfg.setGroup("ToolBar"); | 187 | cfg.setGroup("ToolBar"); |
188 | cfg.writeEntry( "Position", m_barPos ); | 188 | cfg.writeEntry( "Position", m_barPos ); |
189 | cfg.writeEntry( "fixedBars", m_fixedBars ); | 189 | cfg.writeEntry( "fixedBars", m_fixedBars ); |
190 | 190 | ||
191 | cfg.setGroup("Version"); | 191 | cfg.setGroup("Version"); |
192 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); | 192 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); |
193 | cfg.writeEntry( "Mainversion", MAINVERSION ); | 193 | cfg.writeEntry( "Mainversion", MAINVERSION ); |
194 | cfg.writeEntry( "SubVersion", SUBVERSION ); | 194 | cfg.writeEntry( "SubVersion", SUBVERSION ); |
195 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); | 195 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); |
196 | 196 | ||
197 | } | 197 | } |
198 | 198 | ||
199 | } | 199 | } |
200 | 200 | ||
201 | void AbConfig::operator= ( const AbConfig& cnf ) | 201 | void AbConfig::operator= ( const AbConfig& cnf ) |
202 | { | 202 | { |
203 | m_useQtMail = cnf.m_useQtMail; | 203 | m_useQtMail = cnf.m_useQtMail; |
204 | m_useOpieMail = cnf.m_useOpieMail; | 204 | m_useOpieMail = cnf.m_useOpieMail; |
205 | m_useRegExp = cnf.m_useRegExp; | 205 | m_useRegExp = cnf.m_useRegExp; |
206 | m_beCaseSensitive = cnf.m_beCaseSensitive; | 206 | m_beCaseSensitive = cnf.m_beCaseSensitive; |
207 | m_fontSize = cnf.m_fontSize; | 207 | m_fontSize = cnf.m_fontSize; |
208 | m_ordered = cnf.m_ordered; | 208 | m_ordered = cnf.m_ordered; |
209 | m_barPos = cnf.m_barPos; | 209 | m_barPos = cnf.m_barPos; |
210 | m_fixedBars = cnf.m_fixedBars; | 210 | m_fixedBars = cnf.m_fixedBars; |
211 | m_lpSearchMode = cnf.m_lpSearchMode; | 211 | m_lpSearchMode = cnf.m_lpSearchMode; |
212 | } | 212 | } |
213 | 213 | ||
diff --git a/core/pim/addressbook/abconfig.h b/core/pim/addressbook/abconfig.h index 93764f2..c312179 100644 --- a/core/pim/addressbook/abconfig.h +++ b/core/pim/addressbook/abconfig.h | |||
@@ -1,69 +1,69 @@ | |||
1 | #ifndef _ABCONFIG_H_ | 1 | #ifndef _ABCONFIG_H_ |
2 | #define _ABCONFIG_H_ | 2 | #define _ABCONFIG_H_ |
3 | 3 | ||
4 | #include <qstringlist.h> | 4 | #include <qstringlist.h> |
5 | #include <qmainwindow.h> | 5 | #include <qmainwindow.h> |
6 | 6 | ||
7 | class AbConfig | 7 | class AbConfig |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | enum LPSearchMode{ | 10 | enum LPSearchMode{ |
11 | LastName = 0, | 11 | LastName = 0, |
12 | FullName, | 12 | FileAs, |
13 | LASTELEMENT | 13 | LASTELEMENT |
14 | }; | 14 | }; |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | AbConfig(); | 18 | AbConfig(); |
19 | ~AbConfig(); | 19 | ~AbConfig(); |
20 | 20 | ||
21 | // Search Settings | 21 | // Search Settings |
22 | bool useRegExp() const; | 22 | bool useRegExp() const; |
23 | bool useWildCards() const; | 23 | bool useWildCards() const; |
24 | bool beCaseSensitive() const; | 24 | bool beCaseSensitive() const; |
25 | bool useQtMail() const; | 25 | bool useQtMail() const; |
26 | bool useOpieMail() const; | 26 | bool useOpieMail() const; |
27 | int fontSize() const; | 27 | int fontSize() const; |
28 | QValueList<int> orderList() const; | 28 | QValueList<int> orderList() const; |
29 | QMainWindow::ToolBarDock getToolBarPos() const; | 29 | QMainWindow::ToolBarDock getToolBarPos() const; |
30 | bool fixedBars() const; | 30 | bool fixedBars() const; |
31 | LPSearchMode letterPickerSearch() const; | 31 | LPSearchMode letterPickerSearch() const; |
32 | 32 | ||
33 | void setUseRegExp( bool v ); | 33 | void setUseRegExp( bool v ); |
34 | void setUseWildCards( bool v ); | 34 | void setUseWildCards( bool v ); |
35 | void setBeCaseSensitive( bool v ); | 35 | void setBeCaseSensitive( bool v ); |
36 | void setUseQtMail( bool v ); | 36 | void setUseQtMail( bool v ); |
37 | void setUseOpieMail( bool v ); | 37 | void setUseOpieMail( bool v ); |
38 | void setFontSize( int v ); | 38 | void setFontSize( int v ); |
39 | void setOrderList( const QValueList<int>& list ); | 39 | void setOrderList( const QValueList<int>& list ); |
40 | void setToolBarDock( const QMainWindow::ToolBarDock v ); | 40 | void setToolBarDock( const QMainWindow::ToolBarDock v ); |
41 | void setFixedBars( const bool fixed ); | 41 | void setFixedBars( const bool fixed ); |
42 | void setLetterPickerSearch( const LPSearchMode mode ); | 42 | void setLetterPickerSearch( const LPSearchMode mode ); |
43 | 43 | ||
44 | void operator= ( const AbConfig& cnf ); | 44 | void operator= ( const AbConfig& cnf ); |
45 | 45 | ||
46 | void load(); | 46 | void load(); |
47 | void save(); | 47 | void save(); |
48 | 48 | ||
49 | protected: | 49 | protected: |
50 | /* virtual void itemUp(); */ | 50 | /* virtual void itemUp(); */ |
51 | /* virtual void itemDown(); */ | 51 | /* virtual void itemDown(); */ |
52 | 52 | ||
53 | QStringList contFields; | 53 | QStringList contFields; |
54 | 54 | ||
55 | bool m_useQtMail; | 55 | bool m_useQtMail; |
56 | bool m_useOpieMail; | 56 | bool m_useOpieMail; |
57 | bool m_useRegExp; | 57 | bool m_useRegExp; |
58 | bool m_beCaseSensitive; | 58 | bool m_beCaseSensitive; |
59 | int m_fontSize; | 59 | int m_fontSize; |
60 | QValueList<int> m_ordered; | 60 | QValueList<int> m_ordered; |
61 | int m_barPos; | 61 | int m_barPos; |
62 | bool m_fixedBars; | 62 | bool m_fixedBars; |
63 | int m_lpSearchMode; | 63 | int m_lpSearchMode; |
64 | 64 | ||
65 | bool m_changed; | 65 | bool m_changed; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | 68 | ||
69 | #endif | 69 | #endif |
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 664bd3f..477f85b 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -148,193 +148,193 @@ bool AbView::save() | |||
148 | } | 148 | } |
149 | 149 | ||
150 | void AbView::load() | 150 | void AbView::load() |
151 | { | 151 | { |
152 | //qWarning("abView:Load data"); | 152 | //qWarning("abView:Load data"); |
153 | 153 | ||
154 | // Letter Search is stopped at this place | 154 | // Letter Search is stopped at this place |
155 | emit signalClearLetterPicker(); | 155 | emit signalClearLetterPicker(); |
156 | 156 | ||
157 | if ( m_inPersonal ) | 157 | if ( m_inPersonal ) |
158 | // VCard Backend does not sort.. | 158 | // VCard Backend does not sort.. |
159 | m_list = m_contactdb->allRecords(); | 159 | m_list = m_contactdb->allRecords(); |
160 | else{ | 160 | else{ |
161 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 161 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); |
162 | clearForCategory(); | 162 | clearForCategory(); |
163 | } | 163 | } |
164 | 164 | ||
165 | qWarning ("Number of contacts: %d", m_list.count()); | 165 | qWarning ("Number of contacts: %d", m_list.count()); |
166 | 166 | ||
167 | updateView( true ); | 167 | updateView( true ); |
168 | 168 | ||
169 | } | 169 | } |
170 | 170 | ||
171 | void AbView::reload() | 171 | void AbView::reload() |
172 | { | 172 | { |
173 | //qWarning( "void AbView::reload()" ); | 173 | //qWarning( "void AbView::reload()" ); |
174 | 174 | ||
175 | m_contactdb->reload(); | 175 | m_contactdb->reload(); |
176 | load(); | 176 | load(); |
177 | } | 177 | } |
178 | 178 | ||
179 | void AbView::clear() | 179 | void AbView::clear() |
180 | { | 180 | { |
181 | // :SX | 181 | // :SX |
182 | } | 182 | } |
183 | 183 | ||
184 | void AbView::setShowByCategory( const QString& cat ) | 184 | void AbView::setShowByCategory( const QString& cat ) |
185 | { | 185 | { |
186 | //qWarning("AbView::setShowCategory( const QString& cat )"); | 186 | //qWarning("AbView::setShowCategory( const QString& cat )"); |
187 | 187 | ||
188 | int intCat = 0; | 188 | int intCat = 0; |
189 | 189 | ||
190 | // All (cat == NULL) will be stored as -1 | 190 | // All (cat == NULL) will be stored as -1 |
191 | if ( cat.isNull() ) | 191 | if ( cat.isNull() ) |
192 | intCat = -1; | 192 | intCat = -1; |
193 | else | 193 | else |
194 | intCat = mCat.id("Contacts", cat ); | 194 | intCat = mCat.id("Contacts", cat ); |
195 | 195 | ||
196 | // Just do anything if we really change the category | 196 | // Just do anything if we really change the category |
197 | if ( intCat != m_curr_category ){ | 197 | if ( intCat != m_curr_category ){ |
198 | // qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); | 198 | // qWarning ("Categories: Selected %s.. Number: %d", cat.latin1(), m_curr_category); |
199 | 199 | ||
200 | m_curr_category = intCat; | 200 | m_curr_category = intCat; |
201 | emit signalClearLetterPicker(); | 201 | emit signalClearLetterPicker(); |
202 | 202 | ||
203 | load(); | 203 | load(); |
204 | } | 204 | } |
205 | 205 | ||
206 | } | 206 | } |
207 | 207 | ||
208 | void AbView::setShowToView( Views view ) | 208 | void AbView::setShowToView( Views view ) |
209 | { | 209 | { |
210 | //qWarning("void AbView::setShowToView( View %d )", view); | 210 | //qWarning("void AbView::setShowToView( View %d )", view); |
211 | 211 | ||
212 | //qWarning ("Change the View (Category is: %d)", m_curr_category); | 212 | //qWarning ("Change the View (Category is: %d)", m_curr_category); |
213 | 213 | ||
214 | if ( m_curr_View != view ){ | 214 | if ( m_curr_View != view ){ |
215 | m_prev_View = m_curr_View; | 215 | m_prev_View = m_curr_View; |
216 | m_curr_View = view; | 216 | m_curr_View = view; |
217 | 217 | ||
218 | updateView(); | 218 | updateView(); |
219 | } | 219 | } |
220 | 220 | ||
221 | } | 221 | } |
222 | 222 | ||
223 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | 223 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) |
224 | { | 224 | { |
225 | qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); | 225 | qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); |
226 | 226 | ||
227 | assert( mode < AbConfig::LASTELEMENT ); | 227 | assert( mode < AbConfig::LASTELEMENT ); |
228 | 228 | ||
229 | OContact query; | 229 | OContact query; |
230 | if ( c == 0 ){ | 230 | if ( c == 0 ){ |
231 | load(); | 231 | load(); |
232 | return; | 232 | return; |
233 | }else{ | 233 | }else{ |
234 | // If the current Backend is unable to solve the query, we will | 234 | // If the current Backend is unable to solve the query, we will |
235 | // ignore the request .. | 235 | // ignore the request .. |
236 | if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ | 236 | if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ |
237 | return; | 237 | return; |
238 | } | 238 | } |
239 | 239 | ||
240 | switch( mode ){ | 240 | switch( mode ){ |
241 | case AbConfig::LastName: | 241 | case AbConfig::LastName: |
242 | query.setLastName( QString("%1*").arg(c) ); | 242 | query.setLastName( QString("%1*").arg(c) ); |
243 | break; | 243 | break; |
244 | case AbConfig::FullName: | 244 | case AbConfig::FileAs: |
245 | query.setFileAs( QString("%1*").arg(c) ); | 245 | query.setFileAs( QString("%1*").arg(c) ); |
246 | break; | 246 | break; |
247 | default: | 247 | default: |
248 | qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); | 248 | qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); |
249 | qWarning( "I will ignore it.." ); | 249 | qWarning( "I will ignore it.." ); |
250 | return; | 250 | return; |
251 | } | 251 | } |
252 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); | 252 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); |
253 | clearForCategory(); | 253 | clearForCategory(); |
254 | m_curr_Contact = 0; | 254 | m_curr_Contact = 0; |
255 | } | 255 | } |
256 | updateView( true ); | 256 | updateView( true ); |
257 | } | 257 | } |
258 | 258 | ||
259 | void AbView::setListOrder( const QValueList<int>& ordered ) | 259 | void AbView::setListOrder( const QValueList<int>& ordered ) |
260 | { | 260 | { |
261 | m_orderedFields = ordered; | 261 | m_orderedFields = ordered; |
262 | if ( m_abTable ){ | 262 | if ( m_abTable ){ |
263 | m_abTable->setOrderedList( ordered ); | 263 | m_abTable->setOrderedList( ordered ); |
264 | m_abTable->refresh(); | 264 | m_abTable->refresh(); |
265 | } | 265 | } |
266 | updateView(); | 266 | updateView(); |
267 | } | 267 | } |
268 | 268 | ||
269 | 269 | ||
270 | QString AbView::showCategory() const | 270 | QString AbView::showCategory() const |
271 | { | 271 | { |
272 | return mCat.label( "Contacts", m_curr_category ); | 272 | return mCat.label( "Contacts", m_curr_category ); |
273 | } | 273 | } |
274 | 274 | ||
275 | void AbView::showPersonal( bool personal ) | 275 | void AbView::showPersonal( bool personal ) |
276 | { | 276 | { |
277 | //qWarning ("void AbView::showPersonal( %d )", personal); | 277 | //qWarning ("void AbView::showPersonal( %d )", personal); |
278 | 278 | ||
279 | if ( personal ){ | 279 | if ( personal ){ |
280 | 280 | ||
281 | if ( m_inPersonal ) | 281 | if ( m_inPersonal ) |
282 | return; | 282 | return; |
283 | 283 | ||
284 | // Now switch to vCard Backend and load data. | 284 | // Now switch to vCard Backend and load data. |
285 | // The current default backend will be stored | 285 | // The current default backend will be stored |
286 | // to avoid unneeded load/stores. | 286 | // to avoid unneeded load/stores. |
287 | m_storedDB = m_contactdb; | 287 | m_storedDB = m_contactdb; |
288 | 288 | ||
289 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 289 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
290 | addressbookPersonalVCardName() ); | 290 | addressbookPersonalVCardName() ); |
291 | m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 291 | m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
292 | 292 | ||
293 | m_inPersonal = true; | 293 | m_inPersonal = true; |
294 | m_curr_View = CardView; | 294 | m_curr_View = CardView; |
295 | 295 | ||
296 | }else{ | 296 | }else{ |
297 | 297 | ||
298 | if ( !m_inPersonal ) | 298 | if ( !m_inPersonal ) |
299 | return; | 299 | return; |
300 | 300 | ||
301 | // Remove vCard Backend and restore default | 301 | // Remove vCard Backend and restore default |
302 | m_contactdb->save(); | 302 | m_contactdb->save(); |
303 | delete m_contactdb; | 303 | delete m_contactdb; |
304 | 304 | ||
305 | m_contactdb = m_storedDB; | 305 | m_contactdb = m_storedDB; |
306 | m_storedDB = 0l; | 306 | m_storedDB = 0l; |
307 | 307 | ||
308 | m_curr_View = TableView; | 308 | m_curr_View = TableView; |
309 | m_inPersonal = false; | 309 | m_inPersonal = false; |
310 | 310 | ||
311 | } | 311 | } |
312 | load(); | 312 | load(); |
313 | } | 313 | } |
314 | 314 | ||
315 | void AbView::setCurrentUid( int uid ){ | 315 | void AbView::setCurrentUid( int uid ){ |
316 | 316 | ||
317 | m_curr_Contact = uid; | 317 | m_curr_Contact = uid; |
318 | updateView( true ); //true: Don't modificate the UID ! | 318 | updateView( true ); //true: Don't modificate the UID ! |
319 | } | 319 | } |
320 | 320 | ||
321 | 321 | ||
322 | QStringList AbView::categories() | 322 | QStringList AbView::categories() |
323 | { | 323 | { |
324 | mCat.load( categoryFileName() ); | 324 | mCat.load( categoryFileName() ); |
325 | QStringList categoryList = mCat.labels( "Contacts" ); | 325 | QStringList categoryList = mCat.labels( "Contacts" ); |
326 | return categoryList; | 326 | return categoryList; |
327 | } | 327 | } |
328 | 328 | ||
329 | // BEGIN: Slots | 329 | // BEGIN: Slots |
330 | void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | 330 | void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, |
331 | bool , QString cat ) | 331 | bool , QString cat ) |
332 | { | 332 | { |
333 | //qWarning( "void AbView::slotDoFind" ); | 333 | //qWarning( "void AbView::slotDoFind" ); |
334 | 334 | ||
335 | // We reloading the data: Deselect Letterpicker | 335 | // We reloading the data: Deselect Letterpicker |
336 | emit signalClearLetterPicker(); | 336 | emit signalClearLetterPicker(); |
337 | 337 | ||
338 | // Use the current Category if nothing else selected | 338 | // Use the current Category if nothing else selected |
339 | int category = 0; | 339 | int category = 0; |
340 | 340 | ||