-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 7 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 113 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 16 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 31 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 2 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
6 files changed, 105 insertions, 66 deletions
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp index 6d8de91..1914f71 100644 --- a/core/pim/addressbook/ablabel.cpp +++ b/core/pim/addressbook/ablabel.cpp | |||
@@ -70,12 +70,15 @@ OContact AbLabel::currentEntry() | |||
70 | 70 | ||
71 | bool AbLabel::selectContact( int UID ) | 71 | bool AbLabel::selectContact( int UID ) |
72 | { | 72 | { |
73 | 73 | ||
74 | for ( m_itCurContact = m_viewList.begin(); m_itCurContact != m_viewList.end(); ++m_itCurContact){ | 74 | for ( int r = 0; r < m_viewList.count(); ++r ) { |
75 | if ( (*m_itCurContact).uid() == UID ) | 75 | if ( m_viewList.uidAt( r ) == UID ){ |
76 | m_itCurContact.setCurrent( r ); | ||
76 | break; | 77 | break; |
78 | } | ||
77 | } | 79 | } |
80 | |||
78 | sync(); | 81 | sync(); |
79 | 82 | ||
80 | return true; | 83 | return true; |
81 | } | 84 | } |
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index a2617fa..4705c78 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -43,8 +43,10 @@ | |||
43 | #include <stdlib.h> | 43 | #include <stdlib.h> |
44 | 44 | ||
45 | #include <ctype.h> //toupper() for key hack | 45 | #include <ctype.h> //toupper() for key hack |
46 | 46 | ||
47 | #if 0 | ||
48 | |||
47 | /*! | 49 | /*! |
48 | \class AbTableItem abtable.h | 50 | \class AbTableItem abtable.h |
49 | 51 | ||
50 | \brief QTableItem based class for showing a field of an entry | 52 | \brief QTableItem based class for showing a field of an entry |
@@ -111,8 +113,10 @@ void AbPickItem::setContentFromEditor( QWidget *w ) | |||
111 | else | 113 | else |
112 | QTableItem::setContentFromEditor( w ); | 114 | QTableItem::setContentFromEditor( w ); |
113 | } | 115 | } |
114 | 116 | ||
117 | #endif | ||
118 | |||
115 | /*! | 119 | /*! |
116 | \class AbTable abtable.h | 120 | \class AbTable abtable.h |
117 | 121 | ||
118 | \brief QTable based class for showing a list of entries | 122 | \brief QTable based class for showing a list of entries |
@@ -134,9 +138,9 @@ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name | |||
134 | setSorting( TRUE ); | 138 | setSorting( TRUE ); |
135 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), | 139 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), |
136 | this, SLOT(itemClicked(int,int)) ); | 140 | this, SLOT(itemClicked(int,int)) ); |
137 | 141 | ||
138 | contactList.clear(); | 142 | // contactList.clear(); |
139 | //qWarning("C'tor end"); | 143 | //qWarning("C'tor end"); |
140 | } | 144 | } |
141 | 145 | ||
142 | AbTable::~AbTable() | 146 | AbTable::~AbTable() |
@@ -157,9 +161,9 @@ void AbTable::init() | |||
157 | } | 161 | } |
158 | 162 | ||
159 | void AbTable::setContacts( const OContactAccess::List& viewList ) | 163 | void AbTable::setContacts( const OContactAccess::List& viewList ) |
160 | { | 164 | { |
161 | //qWarning("AbTable::setContacts()"); | 165 | qWarning("AbTable::setContacts()"); |
162 | 166 | ||
163 | clear(); | 167 | clear(); |
164 | m_viewList = viewList; | 168 | m_viewList = viewList; |
165 | 169 | ||
@@ -167,15 +171,15 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) | |||
167 | setPaintingEnabled( FALSE ); | 171 | setPaintingEnabled( FALSE ); |
168 | 172 | ||
169 | OContactAccess::List::Iterator it; | 173 | OContactAccess::List::Iterator it; |
170 | setNumRows( m_viewList.count() ); | 174 | setNumRows( m_viewList.count() ); |
171 | int row = 0; | 175 | //int row = 0; |
172 | for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) | 176 | // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) |
173 | insertIntoTable( *it, row++ ); | 177 | // insertIntoTable( *it, row++ ); |
174 | 178 | ||
175 | setSorting( true ); | 179 | // setSorting( true ); |
176 | 180 | ||
177 | resort(); | 181 | // resort(); |
178 | 182 | ||
179 | updateVisible(); | 183 | updateVisible(); |
180 | 184 | ||
181 | setPaintingEnabled( TRUE ); | 185 | setPaintingEnabled( TRUE ); |
@@ -189,25 +193,24 @@ void AbTable::setOrderedList( const QValueList<int> ordered ) | |||
189 | 193 | ||
190 | 194 | ||
191 | bool AbTable::selectContact( int UID ) | 195 | bool AbTable::selectContact( int UID ) |
192 | { | 196 | { |
193 | //qWarning( "AbTable::selectContact( %d )", UID ); | 197 | qWarning( "AbTable::selectContact( %d )", UID ); |
194 | int rows = numRows(); | 198 | int rows = numRows(); |
195 | AbTableItem *abi; | ||
196 | OContact* foundContact = 0l; | 199 | OContact* foundContact = 0l; |
197 | bool found = false; | 200 | bool found = false; |
198 | 201 | ||
199 | setPaintingEnabled( FALSE ); | 202 | setPaintingEnabled( FALSE ); |
203 | qWarning( "search start" ); | ||
200 | for ( int r = 0; r < rows; ++r ) { | 204 | for ( int r = 0; r < rows; ++r ) { |
201 | abi = static_cast<AbTableItem*>( item(r, 0) ); | 205 | if ( m_viewList.uidAt( r ) == UID ){ |
202 | foundContact = &contactList[abi]; | ||
203 | if ( foundContact -> uid() == UID ){ | ||
204 | ensureCellVisible( r, 0 ); | 206 | ensureCellVisible( r, 0 ); |
205 | setCurrentCell( r, 0 ); | 207 | setCurrentCell( r, 0 ); |
206 | found = true; | 208 | found = true; |
207 | break; | 209 | break; |
208 | } | 210 | } |
209 | } | 211 | } |
212 | qWarning( "search end" ); | ||
210 | 213 | ||
211 | if ( !found ){ | 214 | if ( !found ){ |
212 | ensureCellVisible( 0,0 ); | 215 | ensureCellVisible( 0,0 ); |
213 | setCurrentCell( 0, 0 ); | 216 | setCurrentCell( 0, 0 ); |
@@ -217,11 +220,12 @@ bool AbTable::selectContact( int UID ) | |||
217 | 220 | ||
218 | return true; | 221 | return true; |
219 | } | 222 | } |
220 | 223 | ||
224 | #if 0 | ||
221 | void AbTable::insertIntoTable( const OContact& cnt, int row ) | 225 | void AbTable::insertIntoTable( const OContact& cnt, int row ) |
222 | { | 226 | { |
223 | //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); | 227 | qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); |
224 | QString strName; | 228 | QString strName; |
225 | ContactItem contactItem; | 229 | ContactItem contactItem; |
226 | 230 | ||
227 | strName = findContactName( cnt ); | 231 | strName = findContactName( cnt ); |
@@ -239,9 +243,9 @@ void AbTable::insertIntoTable( const OContact& cnt, int row ) | |||
239 | //### cannot do this; table only has two columns at this point | 243 | //### cannot do this; table only has two columns at this point |
240 | // setItem( row, 2, new AbPickItem( this ) ); | 244 | // setItem( row, 2, new AbPickItem( this ) ); |
241 | 245 | ||
242 | } | 246 | } |
243 | 247 | #endif | |
244 | 248 | ||
245 | 249 | ||
246 | void AbTable::columnClicked( int col ) | 250 | void AbTable::columnClicked( int col ) |
247 | { | 251 | { |
@@ -262,9 +266,10 @@ void AbTable::columnClicked( int col ) | |||
262 | } | 266 | } |
263 | 267 | ||
264 | void AbTable::resort() | 268 | void AbTable::resort() |
265 | { | 269 | { |
266 | //qWarning( "void AbTable::resort()" ); | 270 | qWarning( "void AbTable::resort() NOT POSSIBLE !!" ); |
271 | #if 0 | ||
267 | setPaintingEnabled( FALSE ); | 272 | setPaintingEnabled( FALSE ); |
268 | if ( sorting() ) { | 273 | if ( sorting() ) { |
269 | if ( lastSortCol == -1 ) | 274 | if ( lastSortCol == -1 ) |
270 | lastSortCol = 0; | 275 | lastSortCol = 0; |
@@ -272,21 +277,14 @@ void AbTable::resort() | |||
272 | //QMessageBox::information( this, "resort", "resort" ); | 277 | //QMessageBox::information( this, "resort", "resort" ); |
273 | updateVisible(); | 278 | updateVisible(); |
274 | } | 279 | } |
275 | setPaintingEnabled( TRUE ); | 280 | setPaintingEnabled( TRUE ); |
281 | #endif | ||
276 | } | 282 | } |
277 | 283 | ||
278 | OContact AbTable::currentEntry() | 284 | OContact AbTable::currentEntry() |
279 | { | 285 | { |
280 | //qWarning( "OContact AbTable::currentEntry()" ); | 286 | return m_viewList[currentRow()]; |
281 | OContact cnt; | ||
282 | AbTableItem *abItem; | ||
283 | abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); | ||
284 | if ( abItem ) { | ||
285 | cnt = contactList[abItem]; | ||
286 | //cnt = contactList[currentRow()]; | ||
287 | } | ||
288 | return cnt; | ||
289 | } | 287 | } |
290 | 288 | ||
291 | int AbTable::currentEntry_UID() | 289 | int AbTable::currentEntry_UID() |
292 | { | 290 | { |
@@ -294,10 +292,10 @@ int AbTable::currentEntry_UID() | |||
294 | } | 292 | } |
295 | 293 | ||
296 | void AbTable::clear() | 294 | void AbTable::clear() |
297 | { | 295 | { |
298 | //qWarning( "void AbTable::clear()" ); | 296 | qWarning( "void AbTable::clear()" ); |
299 | contactList.clear(); | 297 | // contactList.clear(); |
300 | 298 | ||
301 | setPaintingEnabled( FALSE ); | 299 | setPaintingEnabled( FALSE ); |
302 | for ( int r = 0; r < numRows(); ++r ) { | 300 | for ( int r = 0; r < numRows(); ++r ) { |
303 | for ( int c = 0; c < numCols(); ++c ) { | 301 | for ( int c = 0; c < numCols(); ++c ) { |
@@ -312,9 +310,11 @@ void AbTable::clear() | |||
312 | 310 | ||
313 | // Refresh updates column 2 if the contactsettings changed | 311 | // Refresh updates column 2 if the contactsettings changed |
314 | void AbTable::refresh() | 312 | void AbTable::refresh() |
315 | { | 313 | { |
316 | //qWarning( "void AbTable::refresh()" ); | 314 | qWarning( "void AbTable::refresh() NOT IMPLEMENTED !!" ); |
315 | |||
316 | #if 0 | ||
317 | int rows = numRows(); | 317 | int rows = numRows(); |
318 | AbTableItem *abi; | 318 | AbTableItem *abi; |
319 | ContactItem contactItem; | 319 | ContactItem contactItem; |
320 | 320 | ||
@@ -332,8 +332,10 @@ void AbTable::refresh() | |||
332 | } | 332 | } |
333 | } | 333 | } |
334 | resort(); | 334 | resort(); |
335 | setPaintingEnabled( TRUE ); | 335 | setPaintingEnabled( TRUE ); |
336 | |||
337 | #endif | ||
336 | } | 338 | } |
337 | 339 | ||
338 | void AbTable::keyPressEvent( QKeyEvent *e ) | 340 | void AbTable::keyPressEvent( QKeyEvent *e ) |
339 | { | 341 | { |
@@ -364,10 +366,11 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
364 | } | 366 | } |
365 | 367 | ||
366 | void AbTable::moveTo( char c ) | 368 | void AbTable::moveTo( char c ) |
367 | { | 369 | { |
368 | qWarning( "void AbTable::moveTo( char c )" ); | 370 | qWarning( "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" ); |
369 | 371 | ||
372 | #if 0 | ||
370 | int rows = numRows(); | 373 | int rows = numRows(); |
371 | QString value; | 374 | QString value; |
372 | AbTableItem *abi; | 375 | AbTableItem *abi; |
373 | int r; | 376 | int r; |
@@ -393,11 +396,14 @@ void AbTable::moveTo( char c ) | |||
393 | r--; | 396 | r--; |
394 | } | 397 | } |
395 | } | 398 | } |
396 | setCurrentCell( r, currentColumn() ); | 399 | setCurrentCell( r, currentColumn() ); |
397 | } | ||
398 | 400 | ||
401 | #endif | ||
402 | } | ||
399 | 403 | ||
404 | #if 0 | ||
405 | // Useless.. Nobody uses it .. (se) | ||
400 | QString AbTable::findContactName( const OContact &entry ) | 406 | QString AbTable::findContactName( const OContact &entry ) |
401 | { | 407 | { |
402 | // We use the fileAs, then company, defaultEmail | 408 | // We use the fileAs, then company, defaultEmail |
403 | QString str; | 409 | QString str; |
@@ -409,9 +415,9 @@ QString AbTable::findContactName( const OContact &entry ) | |||
409 | } | 415 | } |
410 | } | 416 | } |
411 | return str; | 417 | return str; |
412 | } | 418 | } |
413 | 419 | #endif | |
414 | 420 | ||
415 | 421 | ||
416 | void AbTable::resizeRows() { | 422 | void AbTable::resizeRows() { |
417 | /* | 423 | /* |
@@ -505,8 +511,9 @@ void AbTable::show() | |||
505 | realignTable(); | 511 | realignTable(); |
506 | QTable::show(); | 512 | QTable::show(); |
507 | } | 513 | } |
508 | 514 | ||
515 | #if 0 | ||
509 | void AbTable::setChoiceNames( const QStringList& list) | 516 | void AbTable::setChoiceNames( const QStringList& list) |
510 | { | 517 | { |
511 | choicenames = list; | 518 | choicenames = list; |
512 | if ( choicenames.isEmpty() ) { | 519 | if ( choicenames.isEmpty() ) { |
@@ -519,8 +526,9 @@ void AbTable::setChoiceNames( const QStringList& list) | |||
519 | horizontalHeader()->setLabel( 2, tr( "Pick" )); | 526 | horizontalHeader()->setLabel( 2, tr( "Pick" )); |
520 | } | 527 | } |
521 | fitColumns(); | 528 | fitColumns(); |
522 | } | 529 | } |
530 | #endif | ||
523 | 531 | ||
524 | void AbTable::itemClicked(int,int col) | 532 | void AbTable::itemClicked(int,int col) |
525 | { | 533 | { |
526 | //qWarning( "AbTable::itemClicked(int, col:%d)", col); | 534 | //qWarning( "AbTable::itemClicked(int, col:%d)", col); |
@@ -531,13 +539,15 @@ void AbTable::itemClicked(int,int col) | |||
531 | emit signalSwitch(); | 539 | emit signalSwitch(); |
532 | } | 540 | } |
533 | } | 541 | } |
534 | 542 | ||
543 | #if 0 | ||
535 | QStringList AbTable::choiceNames() const | 544 | QStringList AbTable::choiceNames() const |
536 | { | 545 | { |
537 | return choicenames; | 546 | return choicenames; |
538 | } | 547 | } |
539 | 548 | ||
549 | #endif | ||
540 | void AbTable::setChoiceSelection( const QValueList<int>& list ) | 550 | void AbTable::setChoiceSelection( const QValueList<int>& list ) |
541 | { | 551 | { |
542 | intFields = list; | 552 | intFields = list; |
543 | } | 553 | } |
@@ -559,10 +569,8 @@ QStringList AbTable::choiceSelection(int /*index*/) const | |||
559 | return r; | 569 | return r; |
560 | } | 570 | } |
561 | 571 | ||
562 | 572 | ||
563 | |||
564 | |||
565 | void AbTable::updateVisible() | 573 | void AbTable::updateVisible() |
566 | { | 574 | { |
567 | //qWarning("void AbTable::updateVisible()"); | 575 | //qWarning("void AbTable::updateVisible()"); |
568 | 576 | ||
@@ -629,8 +637,12 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
629 | const QColorGroup &cg = colorGroup(); | 637 | const QColorGroup &cg = colorGroup(); |
630 | 638 | ||
631 | p->save(); | 639 | p->save(); |
632 | 640 | ||
641 | //qWarning( "Paint row: %d", row ); | ||
642 | |||
643 | OContact act_contact = m_viewList[row]; | ||
644 | |||
633 | // Paint alternating background bars | 645 | // Paint alternating background bars |
634 | if ( (row % 2 ) == 0 ) { | 646 | if ( (row % 2 ) == 0 ) { |
635 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); | 647 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); |
636 | p->setPen( QPen( cg.text() ) ); | 648 | p->setPen( QPen( cg.text() ) ); |
@@ -646,19 +658,34 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
646 | int marg = 2; | 658 | int marg = 2; |
647 | int x = 0; | 659 | int x = 0; |
648 | int y = ( cr.height() - 14 ) / 2; | 660 | int y = ( cr.height() - 14 ) / 2; |
649 | 661 | ||
650 | QPixmap pic = pixmap( row, col ); | 662 | QString nameText = act_contact.fileAs(); |
651 | if ( !pic.isNull() ) | 663 | |
652 | { | 664 | switch( col ){ |
653 | p->drawPixmap( x + marg, y, pixmap( row, col ) ); | 665 | case 0: |
654 | p->drawText( x + marg + pixmap( row, col ).width() + 4,2 + fm.ascent(), text( row, col ) ); | 666 | p->drawText( x + marg,2 + fm.ascent(), nameText ); |
655 | } | 667 | break; |
656 | else | 668 | case 1:{ |
657 | { | 669 | |
658 | p->drawText( x + marg,2 + fm.ascent(), text( row, col ) ); | 670 | ContactItem contactItem = findContactContact( act_contact, 0 ); |
659 | } | 671 | QPixmap contactPic = contactItem.icon; /* pixmap( row, col ); */ |
672 | QString contactText = contactItem.value; | ||
673 | |||
674 | if ( !contactPic.isNull() ) | ||
675 | { | ||
676 | p->drawPixmap( x + marg, y, contactPic ); | ||
677 | p->drawText( x + marg + contactPic.width() | ||
678 | + 4,2 + fm.ascent(), contactText ); | ||
679 | } | ||
680 | else | ||
681 | { | ||
682 | p->drawText( x + marg,2 + fm.ascent(), contactText ); | ||
683 | } | ||
684 | } | ||
685 | break; | ||
660 | 686 | ||
687 | } | ||
661 | p->restore(); | 688 | p->restore(); |
662 | } | 689 | } |
663 | 690 | ||
664 | void AbTable::rowHeightChanged( int row ) | 691 | void AbTable::rowHeightChanged( int row ) |
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 0f7bc29..b9ebe27 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -31,8 +31,9 @@ | |||
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qpixmap.h> | 33 | #include <qpixmap.h> |
34 | 34 | ||
35 | #if 0 | ||
35 | class AbTableItem : public QTableItem | 36 | class AbTableItem : public QTableItem |
36 | { | 37 | { |
37 | public: | 38 | public: |
38 | AbTableItem( QTable *t, EditType et, const QString &s, | 39 | AbTableItem( QTable *t, EditType et, const QString &s, |
@@ -46,8 +47,10 @@ public: | |||
46 | private: | 47 | private: |
47 | QString sortKey; | 48 | QString sortKey; |
48 | }; | 49 | }; |
49 | 50 | ||
51 | #endif | ||
52 | |||
50 | // This is a simple container, storing all contact | 53 | // This is a simple container, storing all contact |
51 | // information | 54 | // information |
52 | class ContactItem | 55 | class ContactItem |
53 | { | 56 | { |
@@ -55,8 +58,9 @@ class ContactItem | |||
55 | QPixmap icon; | 58 | QPixmap icon; |
56 | QString value; | 59 | QString value; |
57 | }; | 60 | }; |
58 | 61 | ||
62 | #if 0 | ||
59 | class AbPickItem : public QTableItem | 63 | class AbPickItem : public QTableItem |
60 | { | 64 | { |
61 | public: | 65 | public: |
62 | AbPickItem( QTable *t ); | 66 | AbPickItem( QTable *t ); |
@@ -67,8 +71,10 @@ public: | |||
67 | private: | 71 | private: |
68 | QGuardedPtr<QComboBox> cb; | 72 | QGuardedPtr<QComboBox> cb; |
69 | }; | 73 | }; |
70 | 74 | ||
75 | #endif | ||
76 | |||
71 | class AbTable : public QTable | 77 | class AbTable : public QTable |
72 | { | 78 | { |
73 | Q_OBJECT | 79 | Q_OBJECT |
74 | 80 | ||
@@ -90,9 +96,9 @@ public: | |||
90 | 96 | ||
91 | // Get the UID of the current selected Entry | 97 | // Get the UID of the current selected Entry |
92 | int currentEntry_UID(); | 98 | int currentEntry_UID(); |
93 | 99 | ||
94 | QString findContactName( const OContact &entry ); | 100 | // QString findContactName( const OContact &entry ); |
95 | 101 | ||
96 | void init(); | 102 | void init(); |
97 | void clear(); | 103 | void clear(); |
98 | void refresh(); | 104 | void refresh(); |
@@ -102,10 +108,10 @@ public: | |||
102 | void viewportPaintEvent( QPaintEvent* e); | 108 | void viewportPaintEvent( QPaintEvent* e); |
103 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); | 109 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); |
104 | 110 | ||
105 | // addresspicker mode (What's that ? se) | 111 | // addresspicker mode (What's that ? se) |
106 | void setChoiceNames( const QStringList& list); | 112 | // void setChoiceNames( const QStringList& list); |
107 | QStringList choiceNames() const; | 113 | // QStringList choiceNames() const; |
108 | void setChoiceSelection( const QValueList<int>& list ); | 114 | void setChoiceSelection( const QValueList<int>& list ); |
109 | QStringList choiceSelection(int index) const; | 115 | QStringList choiceSelection(int index) const; |
110 | 116 | ||
111 | signals: | 117 | signals: |
@@ -128,9 +134,9 @@ protected slots: | |||
128 | void itemClicked(int,int col); | 134 | void itemClicked(int,int col); |
129 | void rowHeightChanged( int row ); | 135 | void rowHeightChanged( int row ); |
130 | 136 | ||
131 | private: | 137 | private: |
132 | void insertIntoTable( const OContact &cnt, int row ); | 138 | // void insertIntoTable( const OContact &cnt, int row ); |
133 | ContactItem findContactContact( const OContact &entry, int row ); | 139 | ContactItem findContactContact( const OContact &entry, int row ); |
134 | void fitColumns(); | 140 | void fitColumns(); |
135 | void resizeRows(); | 141 | void resizeRows(); |
136 | void realignTable(); | 142 | void realignTable(); |
@@ -138,9 +144,9 @@ private: | |||
138 | void updateVisible(); | 144 | void updateVisible(); |
139 | 145 | ||
140 | int lastSortCol; | 146 | int lastSortCol; |
141 | bool asc; | 147 | bool asc; |
142 | QMap<AbTableItem*, OContact> contactList; | 148 | // QMap<AbTableItem*, OContact> contactList; |
143 | QValueList<int> intFields; | 149 | QValueList<int> intFields; |
144 | QStringList choicenames; | 150 | QStringList choicenames; |
145 | bool enablePainting; | 151 | bool enablePainting; |
146 | bool columnVisible; | 152 | bool columnVisible; |
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 477f85b..6cbd556 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -50,8 +50,9 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | |||
50 | m_viewStack( 0l ), | 50 | m_viewStack( 0l ), |
51 | m_abTable( 0l ), | 51 | m_abTable( 0l ), |
52 | m_orderedFields( ordered ) | 52 | m_orderedFields( ordered ) |
53 | { | 53 | { |
54 | qWarning("AbView::c'tor"); | ||
54 | // Load default database and handle syncing myself.. ! | 55 | // Load default database and handle syncing myself.. ! |
55 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), | 56 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), |
56 | mCat.load( categoryFileName() ); | 57 | mCat.load( categoryFileName() ); |
57 | 58 | ||
@@ -96,30 +97,30 @@ AbView::~AbView() | |||
96 | 97 | ||
97 | 98 | ||
98 | void AbView::setView( Views view ) | 99 | void AbView::setView( Views view ) |
99 | { | 100 | { |
100 | //qWarning("AbView::setView( Views view )"); | 101 | qWarning("AbView::setView( Views view )"); |
101 | m_curr_View = view; | 102 | m_curr_View = view; |
102 | load(); | 103 | load(); |
103 | } | 104 | } |
104 | 105 | ||
105 | void AbView::addEntry( const OContact &newContact ) | 106 | void AbView::addEntry( const OContact &newContact ) |
106 | { | 107 | { |
107 | //qWarning("abview:AddContact"); | 108 | qWarning("abview:AddContact"); |
108 | m_contactdb->add ( newContact ); | 109 | m_contactdb->add ( newContact ); |
109 | load(); | 110 | load(); |
110 | 111 | ||
111 | } | 112 | } |
112 | void AbView::removeEntry( const int UID ) | 113 | void AbView::removeEntry( const int UID ) |
113 | { | 114 | { |
114 | //qWarning("abview:RemoveContact"); | 115 | qWarning("abview:RemoveContact"); |
115 | m_contactdb->remove( UID ); | 116 | m_contactdb->remove( UID ); |
116 | load(); | 117 | load(); |
117 | } | 118 | } |
118 | 119 | ||
119 | void AbView::replaceEntry( const OContact &contact ) | 120 | void AbView::replaceEntry( const OContact &contact ) |
120 | { | 121 | { |
121 | //qWarning("abview:ReplaceContact"); | 122 | qWarning("abview:ReplaceContact"); |
122 | m_contactdb->replace( contact ); | 123 | m_contactdb->replace( contact ); |
123 | load(); | 124 | load(); |
124 | 125 | ||
125 | } | 126 | } |
@@ -148,9 +149,9 @@ bool AbView::save() | |||
148 | } | 149 | } |
149 | 150 | ||
150 | void AbView::load() | 151 | void AbView::load() |
151 | { | 152 | { |
152 | //qWarning("abView:Load data"); | 153 | qWarning("abView:Load data"); |
153 | 154 | ||
154 | // Letter Search is stopped at this place | 155 | // Letter Search is stopped at this place |
155 | emit signalClearLetterPicker(); | 156 | emit signalClearLetterPicker(); |
156 | 157 | ||
@@ -158,9 +159,10 @@ void AbView::load() | |||
158 | // VCard Backend does not sort.. | 159 | // VCard Backend does not sort.. |
159 | m_list = m_contactdb->allRecords(); | 160 | m_list = m_contactdb->allRecords(); |
160 | else{ | 161 | else{ |
161 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 162 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); |
162 | clearForCategory(); | 163 | if ( m_curr_category != -1 ) |
164 | clearForCategory(); | ||
163 | } | 165 | } |
164 | 166 | ||
165 | qWarning ("Number of contacts: %d", m_list.count()); | 167 | qWarning ("Number of contacts: %d", m_list.count()); |
166 | 168 | ||
@@ -169,9 +171,9 @@ void AbView::load() | |||
169 | } | 171 | } |
170 | 172 | ||
171 | void AbView::reload() | 173 | void AbView::reload() |
172 | { | 174 | { |
173 | //qWarning( "void AbView::reload()" ); | 175 | qWarning( "void AbView::reload()" ); |
174 | 176 | ||
175 | m_contactdb->reload(); | 177 | m_contactdb->reload(); |
176 | load(); | 178 | load(); |
177 | } | 179 | } |
@@ -182,9 +184,9 @@ void AbView::clear() | |||
182 | } | 184 | } |
183 | 185 | ||
184 | void AbView::setShowByCategory( const QString& cat ) | 186 | void AbView::setShowByCategory( const QString& cat ) |
185 | { | 187 | { |
186 | //qWarning("AbView::setShowCategory( const QString& cat )"); | 188 | qWarning("AbView::setShowCategory( const QString& cat )"); |
187 | 189 | ||
188 | int intCat = 0; | 190 | int intCat = 0; |
189 | 191 | ||
190 | // All (cat == NULL) will be stored as -1 | 192 | // All (cat == NULL) will be stored as -1 |
@@ -206,13 +208,12 @@ void AbView::setShowByCategory( const QString& cat ) | |||
206 | } | 208 | } |
207 | 209 | ||
208 | void AbView::setShowToView( Views view ) | 210 | void AbView::setShowToView( Views view ) |
209 | { | 211 | { |
210 | //qWarning("void AbView::setShowToView( View %d )", view); | 212 | qWarning("void AbView::setShowToView( View %d )", view); |
211 | |||
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 | qWarning ("Change the View (Category is: %d)", m_curr_category); | ||
215 | m_prev_View = m_curr_View; | 216 | m_prev_View = m_curr_View; |
216 | m_curr_View = view; | 217 | m_curr_View = view; |
217 | 218 | ||
218 | updateView(); | 219 | updateView(); |
@@ -249,9 +250,10 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | |||
249 | qWarning( "I will ignore it.." ); | 250 | qWarning( "I will ignore it.." ); |
250 | return; | 251 | return; |
251 | } | 252 | } |
252 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); | 253 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); |
253 | clearForCategory(); | 254 | if ( m_curr_category != -1 ) |
255 | clearForCategory(); | ||
254 | m_curr_Contact = 0; | 256 | m_curr_Contact = 0; |
255 | } | 257 | } |
256 | updateView( true ); | 258 | updateView( true ); |
257 | } | 259 | } |
@@ -273,9 +275,9 @@ QString AbView::showCategory() const | |||
273 | } | 275 | } |
274 | 276 | ||
275 | void AbView::showPersonal( bool personal ) | 277 | void AbView::showPersonal( bool personal ) |
276 | { | 278 | { |
277 | //qWarning ("void AbView::showPersonal( %d )", personal); | 279 | qWarning ("void AbView::showPersonal( %d )", personal); |
278 | 280 | ||
279 | if ( personal ){ | 281 | if ( personal ){ |
280 | 282 | ||
281 | if ( m_inPersonal ) | 283 | if ( m_inPersonal ) |
@@ -361,9 +363,10 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | |||
361 | 363 | ||
362 | // Now remove all contacts with wrong category (if any selected) | 364 | // Now remove all contacts with wrong category (if any selected) |
363 | // This algorithm is a litte bit ineffective, but | 365 | // This algorithm is a litte bit ineffective, but |
364 | // we will not have a lot of matching entries.. | 366 | // we will not have a lot of matching entries.. |
365 | clearForCategory(); | 367 | if ( m_curr_category != -1 ) |
368 | clearForCategory(); | ||
366 | 369 | ||
367 | // Now show all found entries | 370 | // Now show all found entries |
368 | updateView( true ); | 371 | updateView( true ); |
369 | } | 372 | } |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 03c96c8..0ba024e 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -247,9 +247,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
247 | 247 | ||
248 | 248 | ||
249 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); | 249 | QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); |
250 | 250 | ||
251 | m_abView->load(); | 251 | // m_abView->load(); // Already done by c'tor . |
252 | 252 | ||
253 | // Letter Picker | 253 | // Letter Picker |
254 | pLabel = new LetterPicker( listContainer ); | 254 | pLabel = new LetterPicker( listContainer ); |
255 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); | 255 | connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); |
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 9621826..790aa95 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h | |||
@@ -1,9 +1,9 @@ | |||
1 | #ifndef _VERSION_H_ | 1 | #ifndef _VERSION_H_ |
2 | #define _VERSION_H_ | 2 | #define _VERSION_H_ |
3 | 3 | ||
4 | #define MAINVERSION "1" | 4 | #define MAINVERSION "1" |
5 | #define SUBVERSION "0" | 5 | #define SUBVERSION "1" |
6 | #define PATCHVERSION "0" | 6 | #define PATCHVERSION "0" |
7 | 7 | ||
8 | #define APPNAME "OPIE_ADDRESSBOOK" | 8 | #define APPNAME "OPIE_ADDRESSBOOK" |
9 | 9 | ||