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 | |||
@@ -51,9 +51,9 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | |||
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() ); |
@@ -99,30 +99,30 @@ AbView::~AbView() | |||
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 | } |
@@ -144,16 +144,16 @@ Opie::OPimContact AbView::currentEntry() | |||
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 | ||
@@ -165,17 +165,17 @@ void AbView::load() | |||
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 | } |
@@ -186,9 +186,9 @@ void AbView::clear() | |||
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 |
@@ -198,9 +198,9 @@ void AbView::setShowByCategory( const QString& cat ) | |||
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(); |
@@ -211,12 +211,12 @@ void AbView::setShowByCategory( const QString& cat ) | |||
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(); |
@@ -225,9 +225,9 @@ void AbView::setShowToView( Views view ) | |||
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; |
@@ -248,9 +248,9 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | |||
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 ); |
@@ -278,9 +278,9 @@ QString AbView::showCategory() const | |||
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 ) |
@@ -334,9 +334,9 @@ QStringList AbView::categories() | |||
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 | ||
@@ -348,18 +348,18 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | |||
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 | } |
@@ -381,18 +381,18 @@ void AbView::offSearch() | |||
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(); |
@@ -409,9 +409,9 @@ void AbView::clearForCategory() | |||
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 | } |
@@ -419,32 +419,32 @@ void AbView::clearForCategory() | |||
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.. |
@@ -455,9 +455,9 @@ void AbView::updateListinViews() | |||
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 | } |