author | mickeyl <mickeyl> | 2004-04-04 17:03:27 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 17:03:27 (UTC) |
commit | daef74a7e852855f781765fad7969b6c83e2e9c6 (patch) (unidiff) | |
tree | f635b437ba9f6d144c34c5ee58d37954bacc3c6e /core/pim/addressbook/abview.cpp | |
parent | 100def2936503dedc8138d738d68b69d5de66766 (diff) | |
download | opie-daef74a7e852855f781765fad7969b6c83e2e9c6.zip opie-daef74a7e852855f781765fad7969b6c83e2e9c6.tar.gz opie-daef74a7e852855f781765fad7969b6c83e2e9c6.tar.bz2 |
s/Opie::Core::odebug/odebug/ (same with oerr,owarn,ofatal)
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 52e5f59..7a5b6d4 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -49,13 +49,13 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | |||
49 | m_contactdb ( 0l ), | 49 | m_contactdb ( 0l ), |
50 | m_storedDB ( 0l ), | 50 | m_storedDB ( 0l ), |
51 | m_viewStack( 0l ), | 51 | m_viewStack( 0l ), |
52 | m_abTable( 0l ), | 52 | m_abTable( 0l ), |
53 | m_orderedFields( ordered ) | 53 | m_orderedFields( ordered ) |
54 | { | 54 | { |
55 | Opie::Core::owarn << "AbView::c'tor" << oendl; | 55 | owarn << "AbView::c'tor" << oendl; |
56 | // Load default database and handle syncing myself.. ! | 56 | // Load default database and handle syncing myself.. ! |
57 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false ); | 57 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false ); |
58 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available | 58 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available |
59 | mCat.load( categoryFileName() ); | 59 | mCat.load( categoryFileName() ); |
60 | 60 | ||
61 | // Create Layout and put WidgetStack into it. | 61 | // Create Layout and put WidgetStack into it. |
@@ -97,34 +97,34 @@ AbView::~AbView() | |||
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | 100 | ||
101 | void AbView::setView( Views view ) | 101 | void AbView::setView( Views view ) |
102 | { | 102 | { |
103 | Opie::Core::owarn << "AbView::setView( Views view )" << oendl; | 103 | owarn << "AbView::setView( Views view )" << oendl; |
104 | m_curr_View = view; | 104 | m_curr_View = view; |
105 | load(); | 105 | load(); |
106 | } | 106 | } |
107 | 107 | ||
108 | void AbView::addEntry( const Opie::OPimContact &newContact ) | 108 | void AbView::addEntry( const Opie::OPimContact &newContact ) |
109 | { | 109 | { |
110 | Opie::Core::owarn << "AbView::AddContact" << oendl; | 110 | owarn << "AbView::AddContact" << oendl; |
111 | m_contactdb->add ( newContact ); | 111 | m_contactdb->add ( newContact ); |
112 | load(); | 112 | load(); |
113 | 113 | ||
114 | } | 114 | } |
115 | void AbView::removeEntry( const int UID ) | 115 | void AbView::removeEntry( const int UID ) |
116 | { | 116 | { |
117 | Opie::Core::owarn << "AbView;:RemoveContact" << oendl; | 117 | owarn << "AbView;:RemoveContact" << oendl; |
118 | m_contactdb->remove( UID ); | 118 | m_contactdb->remove( UID ); |
119 | load(); | 119 | load(); |
120 | } | 120 | } |
121 | 121 | ||
122 | void AbView::replaceEntry( const Opie::OPimContact &contact ) | 122 | void AbView::replaceEntry( const Opie::OPimContact &contact ) |
123 | { | 123 | { |
124 | Opie::Core::owarn << "AbView::ReplaceContact" << oendl; | 124 | owarn << "AbView::ReplaceContact" << oendl; |
125 | m_contactdb->replace( contact ); | 125 | m_contactdb->replace( contact ); |
126 | load(); | 126 | load(); |
127 | 127 | ||
128 | } | 128 | } |
129 | 129 | ||
130 | Opie::OPimContact AbView::currentEntry() | 130 | Opie::OPimContact AbView::currentEntry() |
@@ -142,20 +142,20 @@ Opie::OPimContact AbView::currentEntry() | |||
142 | m_curr_Contact = currentContact.uid(); | 142 | m_curr_Contact = currentContact.uid(); |
143 | return currentContact; | 143 | return currentContact; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool AbView::save() | 146 | bool AbView::save() |
147 | { | 147 | { |
148 | //Opie::Core::owarn << "AbView::Save data" << oendl; | 148 | //owarn << "AbView::Save data" << oendl; |
149 | 149 | ||
150 | return m_contactdb->save(); | 150 | return m_contactdb->save(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void AbView::load() | 153 | void AbView::load() |
154 | { | 154 | { |
155 | Opie::Core::owarn << "AbView::Load data" << oendl; | 155 | owarn << "AbView::Load data" << oendl; |
156 | 156 | ||
157 | // Letter Search is stopped at this place | 157 | // Letter Search is stopped at this place |
158 | emit signalClearLetterPicker(); | 158 | emit signalClearLetterPicker(); |
159 | 159 | ||
160 | if ( m_inPersonal ) | 160 | if ( m_inPersonal ) |
161 | // VCard Backend does not sort.. | 161 | // VCard Backend does not sort.. |
@@ -163,73 +163,73 @@ void AbView::load() | |||
163 | else{ | 163 | else{ |
164 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 164 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); |
165 | if ( m_curr_category != -1 ) | 165 | if ( m_curr_category != -1 ) |
166 | clearForCategory(); | 166 | clearForCategory(); |
167 | } | 167 | } |
168 | 168 | ||
169 | Opie::Core::owarn << "Number of contacts: " << m_list.count() << oendl; | 169 | owarn << "Number of contacts: " << m_list.count() << oendl; |
170 | 170 | ||
171 | updateView( true ); | 171 | updateView( true ); |
172 | 172 | ||
173 | } | 173 | } |
174 | 174 | ||
175 | void AbView::reload() | 175 | void AbView::reload() |
176 | { | 176 | { |
177 | Opie::Core::owarn << "AbView::::reload()" << oendl; | 177 | owarn << "AbView::::reload()" << oendl; |
178 | 178 | ||
179 | m_contactdb->reload(); | 179 | m_contactdb->reload(); |
180 | load(); | 180 | load(); |
181 | } | 181 | } |
182 | 182 | ||
183 | void AbView::clear() | 183 | void AbView::clear() |
184 | { | 184 | { |
185 | // :SX | 185 | // :SX |
186 | } | 186 | } |
187 | 187 | ||
188 | void AbView::setShowByCategory( const QString& cat ) | 188 | void AbView::setShowByCategory( const QString& cat ) |
189 | { | 189 | { |
190 | Opie::Core::owarn << "AbView::setShowCategory( const QString& cat )" << oendl; | 190 | owarn << "AbView::setShowCategory( const QString& cat )" << oendl; |
191 | 191 | ||
192 | int intCat = 0; | 192 | int intCat = 0; |
193 | 193 | ||
194 | // All (cat == NULL) will be stored as -1 | 194 | // All (cat == NULL) will be stored as -1 |
195 | if ( cat.isNull() ) | 195 | if ( cat.isNull() ) |
196 | intCat = -1; | 196 | intCat = -1; |
197 | else | 197 | else |
198 | intCat = mCat.id("Contacts", cat ); | 198 | intCat = mCat.id("Contacts", cat ); |
199 | 199 | ||
200 | // Just do anything if we really change the category | 200 | // Just do anything if we really change the category |
201 | if ( intCat != m_curr_category ){ | 201 | if ( intCat != m_curr_category ){ |
202 | // Opie::Core::owarn << "Categories: Selected " << cat << ".. Number: " | 202 | // owarn << "Categories: Selected " << cat << ".. Number: " |
203 | // << m_curr_category << oendl; | 203 | // << m_curr_category << oendl; |
204 | 204 | ||
205 | m_curr_category = intCat; | 205 | m_curr_category = intCat; |
206 | emit signalClearLetterPicker(); | 206 | emit signalClearLetterPicker(); |
207 | 207 | ||
208 | load(); | 208 | load(); |
209 | } | 209 | } |
210 | 210 | ||
211 | } | 211 | } |
212 | 212 | ||
213 | void AbView::setShowToView( Views view ) | 213 | void AbView::setShowToView( Views view ) |
214 | { | 214 | { |
215 | Opie::Core::owarn << "void AbView::setShowToView( View " << view << " )" << oendl; | 215 | owarn << "void AbView::setShowToView( View " << view << " )" << oendl; |
216 | 216 | ||
217 | if ( m_curr_View != view ){ | 217 | if ( m_curr_View != view ){ |
218 | Opie::Core::owarn << "Change the View (Category is: " << m_curr_category << ")" << oendl; | 218 | owarn << "Change the View (Category is: " << m_curr_category << ")" << oendl; |
219 | m_prev_View = m_curr_View; | 219 | m_prev_View = m_curr_View; |
220 | m_curr_View = view; | 220 | m_curr_View = view; |
221 | 221 | ||
222 | updateView(); | 222 | updateView(); |
223 | } | 223 | } |
224 | 224 | ||
225 | } | 225 | } |
226 | 226 | ||
227 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | 227 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) |
228 | { | 228 | { |
229 | Opie::Core::owarn << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; | 229 | owarn << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; |
230 | 230 | ||
231 | assert( mode < AbConfig::LASTELEMENT ); | 231 | assert( mode < AbConfig::LASTELEMENT ); |
232 | 232 | ||
233 | Opie::OPimContact query; | 233 | Opie::OPimContact query; |
234 | if ( c == 0 ){ | 234 | if ( c == 0 ){ |
235 | load(); | 235 | load(); |
@@ -246,13 +246,13 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | |||
246 | query.setLastName( QString("%1*").arg(c) ); | 246 | query.setLastName( QString("%1*").arg(c) ); |
247 | break; | 247 | break; |
248 | case AbConfig::FileAs: | 248 | case AbConfig::FileAs: |
249 | query.setFileAs( QString("%1*").arg(c) ); | 249 | query.setFileAs( QString("%1*").arg(c) ); |
250 | break; | 250 | break; |
251 | default: | 251 | default: |
252 | Opie::Core::owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl | 252 | owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl |
253 | << "I will ignore it.." << oendl; | 253 | << "I will ignore it.." << oendl; |
254 | return; | 254 | return; |
255 | } | 255 | } |
256 | m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); | 256 | m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); |
257 | if ( m_curr_category != -1 ) | 257 | if ( m_curr_category != -1 ) |
258 | clearForCategory(); | 258 | clearForCategory(); |
@@ -276,13 +276,13 @@ QString AbView::showCategory() const | |||
276 | { | 276 | { |
277 | return mCat.label( "Contacts", m_curr_category ); | 277 | return mCat.label( "Contacts", m_curr_category ); |
278 | } | 278 | } |
279 | 279 | ||
280 | void AbView::showPersonal( bool personal ) | 280 | void AbView::showPersonal( bool personal ) |
281 | { | 281 | { |
282 | Opie::Core::owarn << "void AbView::showPersonal( " << personal << " )" << oendl; | 282 | owarn << "void AbView::showPersonal( " << personal << " )" << oendl; |
283 | 283 | ||
284 | if ( personal ){ | 284 | if ( personal ){ |
285 | 285 | ||
286 | if ( m_inPersonal ) | 286 | if ( m_inPersonal ) |
287 | return; | 287 | return; |
288 | 288 | ||
@@ -332,13 +332,13 @@ QStringList AbView::categories() | |||
332 | } | 332 | } |
333 | 333 | ||
334 | // BEGIN: Slots | 334 | // BEGIN: Slots |
335 | void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | 335 | void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, |
336 | bool , QString cat ) | 336 | bool , QString cat ) |
337 | { | 337 | { |
338 | //Opie::Core::owarn << "void AbView::slotDoFind" << oendl; | 338 | //owarn << "void AbView::slotDoFind" << oendl; |
339 | 339 | ||
340 | // We reloading the data: Deselect Letterpicker | 340 | // We reloading the data: Deselect Letterpicker |
341 | emit signalClearLetterPicker(); | 341 | emit signalClearLetterPicker(); |
342 | 342 | ||
343 | // Use the current Category if nothing else selected | 343 | // Use the current Category if nothing else selected |
344 | int category = 0; | 344 | int category = 0; |
@@ -346,22 +346,22 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | |||
346 | if ( cat.isEmpty() ) | 346 | if ( cat.isEmpty() ) |
347 | category = m_curr_category; | 347 | category = m_curr_category; |
348 | else{ | 348 | else{ |
349 | category = mCat.id("Contacts", cat ); | 349 | category = mCat.id("Contacts", cat ); |
350 | } | 350 | } |
351 | 351 | ||
352 | //Opie::Core::owarn << "Find in Category " << category << oendl; | 352 | //owarn << "Find in Category " << category << oendl; |
353 | 353 | ||
354 | QRegExp r( str ); | 354 | QRegExp r( str ); |
355 | r.setCaseSensitive( caseSensitive ); | 355 | r.setCaseSensitive( caseSensitive ); |
356 | r.setWildcard( !useRegExp ); | 356 | r.setWildcard( !useRegExp ); |
357 | 357 | ||
358 | // Get all matching entries out of the database | 358 | // Get all matching entries out of the database |
359 | m_list = m_contactdb->matchRegexp( r ); | 359 | m_list = m_contactdb->matchRegexp( r ); |
360 | 360 | ||
361 | //Opie::Core::owarn << "Found: " << m_list.count() << oendl; | 361 | //owarn << "Found: " << m_list.count() << oendl; |
362 | if ( m_list.count() == 0 ){ | 362 | if ( m_list.count() == 0 ){ |
363 | emit signalNotFound(); | 363 | emit signalNotFound(); |
364 | return; | 364 | return; |
365 | } | 365 | } |
366 | 366 | ||
367 | // Now remove all contacts with wrong category (if any selected) | 367 | // Now remove all contacts with wrong category (if any selected) |
@@ -379,22 +379,22 @@ void AbView::offSearch() | |||
379 | m_inSearch = false; | 379 | m_inSearch = false; |
380 | 380 | ||
381 | load(); | 381 | load(); |
382 | } | 382 | } |
383 | 383 | ||
384 | void AbView::slotSwitch(){ | 384 | void AbView::slotSwitch(){ |
385 | //Opie::Core::owarn << "AbView::slotSwitch()" << oendl; | 385 | //owarn << "AbView::slotSwitch()" << oendl; |
386 | 386 | ||
387 | m_prev_View = m_curr_View; | 387 | m_prev_View = m_curr_View; |
388 | switch ( (int) m_curr_View ){ | 388 | switch ( (int) m_curr_View ){ |
389 | case TableView: | 389 | case TableView: |
390 | Opie::Core::owarn << "Switching to CardView" << oendl; | 390 | owarn << "Switching to CardView" << oendl; |
391 | m_curr_View = CardView; | 391 | m_curr_View = CardView; |
392 | break; | 392 | break; |
393 | case CardView: | 393 | case CardView: |
394 | Opie::Core::owarn << "Switching to TableView" << oendl; | 394 | owarn << "Switching to TableView" << oendl; |
395 | m_curr_View = TableView; | 395 | m_curr_View = TableView; |
396 | break; | 396 | break; |
397 | } | 397 | } |
398 | updateView(); | 398 | updateView(); |
399 | 399 | ||
400 | } | 400 | } |
@@ -407,59 +407,59 @@ void AbView::clearForCategory() | |||
407 | // Now remove all contacts with wrong category if any category selected | 407 | // Now remove all contacts with wrong category if any category selected |
408 | 408 | ||
409 | Opie::OPimContactAccess::List allList = m_list; | 409 | Opie::OPimContactAccess::List allList = m_list; |
410 | if ( m_curr_category != -1 ){ | 410 | if ( m_curr_category != -1 ){ |
411 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 411 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
412 | if ( !contactCompare( *it, m_curr_category ) ){ | 412 | if ( !contactCompare( *it, m_curr_category ) ){ |
413 | //Opie::Core::owarn << "Removing " << (*it).uid() << oendl; | 413 | //owarn << "Removing " << (*it).uid() << oendl; |
414 | m_list.remove( (*it).uid() ); | 414 | m_list.remove( (*it).uid() ); |
415 | } | 415 | } |
416 | } | 416 | } |
417 | } | 417 | } |
418 | 418 | ||
419 | } | 419 | } |
420 | 420 | ||
421 | bool AbView::contactCompare( const Opie::OPimContact &cnt, int category ) | 421 | bool AbView::contactCompare( const Opie::OPimContact &cnt, int category ) |
422 | { | 422 | { |
423 | //Opie::Core::owarn << "bool AbView::contactCompare( const Opie::OPimContact &cnt, " | 423 | //owarn << "bool AbView::contactCompare( const Opie::OPimContact &cnt, " |
424 | // << category << " )" << oendl; | 424 | // << category << " )" << oendl; |
425 | 425 | ||
426 | bool returnMe; | 426 | bool returnMe; |
427 | QArray<int> cats; | 427 | QArray<int> cats; |
428 | cats = cnt.categories(); | 428 | cats = cnt.categories(); |
429 | 429 | ||
430 | //Opie::Core::owarn << "Number of categories: " << cats.count() << oendl; | 430 | //owarn << "Number of categories: " << cats.count() << oendl; |
431 | 431 | ||
432 | returnMe = false; | 432 | returnMe = false; |
433 | if ( cats.count() == 0 && category == 0 ) | 433 | if ( cats.count() == 0 && category == 0 ) |
434 | // Contacts with no category will just shown on "All" and "Unfiled" | 434 | // Contacts with no category will just shown on "All" and "Unfiled" |
435 | returnMe = true; | 435 | returnMe = true; |
436 | else { | 436 | else { |
437 | int i; | 437 | int i; |
438 | for ( i = 0; i < int(cats.count()); i++ ) { | 438 | for ( i = 0; i < int(cats.count()); i++ ) { |
439 | //Opie::Core::owarn << "Comparing " << cats[i] << " with " << category << oendl; | 439 | //owarn << "Comparing " << cats[i] << " with " << category << oendl; |
440 | if ( cats[i] == category ) { | 440 | if ( cats[i] == category ) { |
441 | returnMe = true; | 441 | returnMe = true; |
442 | break; | 442 | break; |
443 | } | 443 | } |
444 | } | 444 | } |
445 | } | 445 | } |
446 | //Opie::Core::owarn << "Return: " << returnMe << oendl; | 446 | //owarn << "Return: " << returnMe << oendl; |
447 | return returnMe; | 447 | return returnMe; |
448 | } | 448 | } |
449 | 449 | ||
450 | // In Some rare cases we have to update all lists.. | 450 | // In Some rare cases we have to update all lists.. |
451 | void AbView::updateListinViews() | 451 | void AbView::updateListinViews() |
452 | { | 452 | { |
453 | m_abTable -> setContacts( m_list ); | 453 | m_abTable -> setContacts( m_list ); |
454 | m_ablabel -> setContacts( m_list ); | 454 | m_ablabel -> setContacts( m_list ); |
455 | } | 455 | } |
456 | 456 | ||
457 | void AbView::updateView( bool newdata ) | 457 | void AbView::updateView( bool newdata ) |
458 | { | 458 | { |
459 | //Opie::Core::owarn << "AbView::updateView()" << oendl; | 459 | //owarn << "AbView::updateView()" << oendl; |
460 | 460 | ||
461 | if ( m_viewStack -> visibleWidget() ){ | 461 | if ( m_viewStack -> visibleWidget() ){ |
462 | m_viewStack -> visibleWidget() -> clearFocus(); | 462 | m_viewStack -> visibleWidget() -> clearFocus(); |
463 | } | 463 | } |
464 | 464 | ||
465 | // If we switching the view, we have to store some information | 465 | // If we switching the view, we have to store some information |