Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 29f4383..cd77b13 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -22,2 +22,4 @@ | |||
22 | 22 | ||
23 | #include <opie2/opimrecordlist.h> | ||
24 | |||
23 | #include <qpe/timestring.h> | 25 | #include <qpe/timestring.h> |
@@ -25,5 +27,2 @@ | |||
25 | 27 | ||
26 | #include <opie/orecordlist.h> | ||
27 | |||
28 | |||
29 | #include "abtable.h" | 28 | #include "abtable.h" |
@@ -41,3 +40,3 @@ | |||
41 | \class AbTableItem abtable.h | 40 | \class AbTableItem abtable.h |
42 | 41 | ||
43 | \brief QTableItem based class for showing a field of an entry | 42 | \brief QTableItem based class for showing a field of an entry |
@@ -68,3 +67,3 @@ void AbTableItem::setItem( const QString &txt, const QString &secondKey ) | |||
68 | sortKey = Qtopia::buildSortKey( txt, secondKey ); | 67 | sortKey = Qtopia::buildSortKey( txt, secondKey ); |
69 | 68 | ||
70 | // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); | 69 | // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); |
@@ -74,3 +73,3 @@ void AbTableItem::setItem( const QString &txt, const QString &secondKey ) | |||
74 | \class AbPickItem abtable.h | 73 | \class AbPickItem abtable.h |
75 | 74 | ||
76 | \brief QTableItem based class for showing slection of an entry | 75 | \brief QTableItem based class for showing slection of an entry |
@@ -111,3 +110,3 @@ void AbPickItem::setContentFromEditor( QWidget *w ) | |||
111 | \class AbTable abtable.h | 110 | \class AbTable abtable.h |
112 | 111 | ||
113 | \brief QTable based class for showing a list of entries | 112 | \brief QTable based class for showing a list of entries |
@@ -145,3 +144,3 @@ void AbTable::init() | |||
145 | setNumCols( 2 ); | 144 | setNumCols( 2 ); |
146 | 145 | ||
147 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); | 146 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); |
@@ -153,3 +152,3 @@ void AbTable::init() | |||
153 | 152 | ||
154 | void AbTable::setContacts( const OContactAccess::List& viewList ) | 153 | void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) |
155 | { | 154 | { |
@@ -162,4 +161,4 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) | |||
162 | setPaintingEnabled( FALSE ); | 161 | setPaintingEnabled( FALSE ); |
163 | 162 | ||
164 | OContactAccess::List::Iterator it; | 163 | Opie::OPimContactAccess::List::Iterator it; |
165 | setNumRows( m_viewList.count() ); | 164 | setNumRows( m_viewList.count() ); |
@@ -168,3 +167,3 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) | |||
168 | // insertIntoTable( *it, row++ ); | 167 | // insertIntoTable( *it, row++ ); |
169 | 168 | ||
170 | // setSorting( true ); | 169 | // setSorting( true ); |
@@ -189,3 +188,3 @@ bool AbTable::selectContact( int UID ) | |||
189 | int rows = numRows(); | 188 | int rows = numRows(); |
190 | OContact* foundContact = 0l; | 189 | Opie::OPimContact* foundContact = 0l; |
191 | bool found = false; | 190 | bool found = false; |
@@ -215,11 +214,11 @@ bool AbTable::selectContact( int UID ) | |||
215 | #if 0 | 214 | #if 0 |
216 | void AbTable::insertIntoTable( const OContact& cnt, int row ) | 215 | void AbTable::insertIntoTable( const Opie::OPimContact& cnt, int row ) |
217 | { | 216 | { |
218 | qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); | 217 | qWarning( "void AbTable::insertIntoTable( const Opie::OPimContact& cnt, %d )", row ); |
219 | QString strName; | 218 | QString strName; |
220 | ContactItem contactItem; | 219 | ContactItem contactItem; |
221 | 220 | ||
222 | strName = findContactName( cnt ); | 221 | strName = findContactName( cnt ); |
223 | contactItem = findContactContact( cnt, row ); | 222 | contactItem = findContactContact( cnt, row ); |
224 | 223 | ||
225 | AbTableItem *ati; | 224 | AbTableItem *ati; |
@@ -232,6 +231,6 @@ void AbTable::insertIntoTable( const OContact& cnt, int row ) | |||
232 | setItem( row, 1, ati ); | 231 | setItem( row, 1, ati ); |
233 | 232 | ||
234 | //### cannot do this; table only has two columns at this point | 233 | //### cannot do this; table only has two columns at this point |
235 | // setItem( row, 2, new AbPickItem( this ) ); | 234 | // setItem( row, 2, new AbPickItem( this ) ); |
236 | 235 | ||
237 | } | 236 | } |
@@ -244,6 +243,6 @@ void AbTable::columnClicked( int col ) | |||
244 | return; | 243 | return; |
245 | 244 | ||
246 | if ( lastSortCol == -1 ) | 245 | if ( lastSortCol == -1 ) |
247 | lastSortCol = col; | 246 | lastSortCol = col; |
248 | 247 | ||
249 | if ( col == lastSortCol ) { | 248 | if ( col == lastSortCol ) { |
@@ -274,4 +273,4 @@ void AbTable::resort() | |||
274 | 273 | ||
275 | OContact AbTable::currentEntry() | 274 | Opie::OPimContact AbTable::currentEntry() |
276 | { | 275 | { |
277 | return m_viewList[currentRow()]; | 276 | return m_viewList[currentRow()]; |
@@ -333,6 +332,6 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
333 | char key = toupper( e->ascii() ); | 332 | char key = toupper( e->ascii() ); |
334 | 333 | ||
335 | if ( key >= 'A' && key <= 'Z' ) | 334 | if ( key >= 'A' && key <= 'Z' ) |
336 | moveTo( key ); | 335 | moveTo( key ); |
337 | 336 | ||
338 | //qWarning("Received key .."); | 337 | //qWarning("Received key .."); |
@@ -355,3 +354,3 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
355 | } | 354 | } |
356 | 355 | ||
357 | } | 356 | } |
@@ -361,3 +360,3 @@ void AbTable::moveTo( char c ) | |||
361 | qWarning( "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" ); | 360 | qWarning( "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" ); |
362 | 361 | ||
363 | #if 0 | 362 | #if 0 |
@@ -396,3 +395,3 @@ void AbTable::moveTo( char c ) | |||
396 | // Useless.. Nobody uses it .. (se) | 395 | // Useless.. Nobody uses it .. (se) |
397 | QString AbTable::findContactName( const OContact &entry ) | 396 | QString AbTable::findContactName( const Opie::OPimContact &entry ) |
398 | { | 397 | { |
@@ -477,8 +476,8 @@ void AbTable::fitColumns() | |||
477 | qWarning( "void AbTable::fitColumns()" ); | 476 | qWarning( "void AbTable::fitColumns()" ); |
478 | int contentsWidth = visibleWidth() / 2; | 477 | int contentsWidth = visibleWidth() / 2; |
479 | // Fix to better value | 478 | // Fix to better value |
480 | // contentsWidth = 130; | 479 | // contentsWidth = 130; |
481 | 480 | ||
482 | setPaintingEnabled( FALSE ); | 481 | setPaintingEnabled( FALSE ); |
483 | 482 | ||
484 | if ( columnVisible == false ){ | 483 | if ( columnVisible == false ){ |
@@ -487,3 +486,3 @@ void AbTable::fitColumns() | |||
487 | } | 486 | } |
488 | 487 | ||
489 | //qWarning("Width: %d", contentsWidth); | 488 | //qWarning("Width: %d", contentsWidth); |
@@ -549,6 +548,6 @@ QStringList AbTable::choiceSelection(int /*index*/) const | |||
549 | /* ###### | 548 | /* ###### |
550 | 549 | ||
551 | QString selname = choicenames.at(index); | 550 | QString selname = choicenames.at(index); |
552 | for (each row) { | 551 | for (each row) { |
553 | OContact *c = contactForRow(row); | 552 | Opie::OPimContact *c = contactForRow(row); |
554 | if ( text(row,2) == selname ) { | 553 | if ( text(row,2) == selname ) { |
@@ -557,3 +556,3 @@ QStringList AbTable::choiceSelection(int /*index*/) const | |||
557 | } | 556 | } |
558 | 557 | ||
559 | */ | 558 | */ |
@@ -571,5 +570,5 @@ void AbTable::updateVisible() | |||
571 | selectedRow = 0; | 570 | selectedRow = 0; |
572 | 571 | ||
573 | visible = 0; | 572 | visible = 0; |
574 | 573 | ||
575 | setPaintingEnabled( FALSE ); | 574 | setPaintingEnabled( FALSE ); |
@@ -594,3 +593,3 @@ void AbTable::updateVisible() | |||
594 | setCurrentCell( -1, 0 ); | 593 | setCurrentCell( -1, 0 ); |
595 | 594 | ||
596 | setPaintingEnabled( TRUE ); | 595 | setPaintingEnabled( TRUE ); |
@@ -633,3 +632,3 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
633 | 632 | ||
634 | OContact act_contact = m_viewList[row]; | 633 | Opie::OPimContact act_contact = m_viewList[row]; |
635 | 634 | ||
@@ -655,3 +654,3 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
655 | switch( col ){ | 654 | switch( col ){ |
656 | case 0: | 655 | case 0: |
657 | p->drawText( x + marg,2 + fm.ascent(), nameText ); | 656 | p->drawText( x + marg,2 + fm.ascent(), nameText ); |
@@ -663,3 +662,3 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
663 | QString contactText = contactItem.value; | 662 | QString contactText = contactItem.value; |
664 | 663 | ||
665 | if ( !contactPic.isNull() ) | 664 | if ( !contactPic.isNull() ) |
@@ -667,3 +666,3 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
667 | p->drawPixmap( x + marg, y, contactPic ); | 666 | p->drawPixmap( x + marg, y, contactPic ); |
668 | p->drawText( x + marg + contactPic.width() | 667 | p->drawText( x + marg + contactPic.width() |
669 | + 4,2 + fm.ascent(), contactText ); | 668 | + 4,2 + fm.ascent(), contactText ); |
@@ -686,3 +685,3 @@ void AbTable::rowHeightChanged( int row ) | |||
686 | } | 685 | } |
687 | ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) | 686 | ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) |
688 | { | 687 | { |