Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 25 |
1 files changed, 12 insertions, 13 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 | |||
@@ -17,18 +17,17 @@ | |||
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | 22 | ||
23 | #include <opie2/opimrecordlist.h> | ||
24 | |||
23 | #include <qpe/timestring.h> | 25 | #include <qpe/timestring.h> |
24 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
25 | 27 | ||
26 | #include <opie/orecordlist.h> | ||
27 | |||
28 | |||
29 | #include "abtable.h" | 28 | #include "abtable.h" |
30 | 29 | ||
31 | #include <errno.h> | 30 | #include <errno.h> |
32 | #include <fcntl.h> | 31 | #include <fcntl.h> |
33 | #include <unistd.h> | 32 | #include <unistd.h> |
34 | #include <stdlib.h> | 33 | #include <stdlib.h> |
@@ -148,23 +147,23 @@ void AbTable::init() | |||
148 | horizontalHeader()->setLabel( 1, tr( "Contact" )); | 147 | horizontalHeader()->setLabel( 1, tr( "Contact" )); |
149 | setLeftMargin( 0 ); | 148 | setLeftMargin( 0 ); |
150 | verticalHeader()->hide(); | 149 | verticalHeader()->hide(); |
151 | columnVisible = true; | 150 | columnVisible = true; |
152 | } | 151 | } |
153 | 152 | ||
154 | void AbTable::setContacts( const OContactAccess::List& viewList ) | 153 | void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) |
155 | { | 154 | { |
156 | qWarning("AbTable::setContacts()"); | 155 | qWarning("AbTable::setContacts()"); |
157 | 156 | ||
158 | clear(); | 157 | clear(); |
159 | m_viewList = viewList; | 158 | m_viewList = viewList; |
160 | 159 | ||
161 | setSorting( false ); | 160 | setSorting( false ); |
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() ); |
166 | //int row = 0; | 165 | //int row = 0; |
167 | // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) | 166 | // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) |
168 | // insertIntoTable( *it, row++ ); | 167 | // insertIntoTable( *it, row++ ); |
169 | 168 | ||
170 | // setSorting( true ); | 169 | // setSorting( true ); |
@@ -184,13 +183,13 @@ void AbTable::setOrderedList( const QValueList<int> ordered ) | |||
184 | 183 | ||
185 | 184 | ||
186 | bool AbTable::selectContact( int UID ) | 185 | bool AbTable::selectContact( int UID ) |
187 | { | 186 | { |
188 | qWarning( "AbTable::selectContact( %d )", UID ); | 187 | qWarning( "AbTable::selectContact( %d )", 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; |
192 | 191 | ||
193 | setPaintingEnabled( FALSE ); | 192 | setPaintingEnabled( FALSE ); |
194 | qWarning( "search start" ); | 193 | qWarning( "search start" ); |
195 | for ( int r = 0; r < rows; ++r ) { | 194 | for ( int r = 0; r < rows; ++r ) { |
196 | if ( m_viewList.uidAt( r ) == UID ){ | 195 | if ( m_viewList.uidAt( r ) == UID ){ |
@@ -210,15 +209,15 @@ bool AbTable::selectContact( int UID ) | |||
210 | setPaintingEnabled( TRUE ); | 209 | setPaintingEnabled( TRUE ); |
211 | 210 | ||
212 | return true; | 211 | return true; |
213 | } | 212 | } |
214 | 213 | ||
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 | ||
@@ -269,13 +268,13 @@ void AbTable::resort() | |||
269 | updateVisible(); | 268 | updateVisible(); |
270 | } | 269 | } |
271 | setPaintingEnabled( TRUE ); | 270 | setPaintingEnabled( TRUE ); |
272 | #endif | 271 | #endif |
273 | } | 272 | } |
274 | 273 | ||
275 | OContact AbTable::currentEntry() | 274 | Opie::OPimContact AbTable::currentEntry() |
276 | { | 275 | { |
277 | return m_viewList[currentRow()]; | 276 | return m_viewList[currentRow()]; |
278 | } | 277 | } |
279 | 278 | ||
280 | int AbTable::currentEntry_UID() | 279 | int AbTable::currentEntry_UID() |
281 | { | 280 | { |
@@ -391,13 +390,13 @@ void AbTable::moveTo( char c ) | |||
391 | 390 | ||
392 | #endif | 391 | #endif |
393 | } | 392 | } |
394 | 393 | ||
395 | #if 0 | 394 | #if 0 |
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 | { |
399 | // We use the fileAs, then company, defaultEmail | 398 | // We use the fileAs, then company, defaultEmail |
400 | QString str; | 399 | QString str; |
401 | str = entry.fileAs(); | 400 | str = entry.fileAs(); |
402 | if ( str.isEmpty() ) { | 401 | if ( str.isEmpty() ) { |
403 | str = entry.company(); | 402 | str = entry.company(); |
@@ -547,13 +546,13 @@ QStringList AbTable::choiceSelection(int /*index*/) const | |||
547 | { | 546 | { |
548 | QStringList r; | 547 | QStringList r; |
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 ) { |
555 | r.append(c->email); | 554 | r.append(c->email); |
556 | } | 555 | } |
557 | } | 556 | } |
558 | 557 | ||
559 | */ | 558 | */ |
@@ -628,13 +627,13 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
628 | const QColorGroup &cg = colorGroup(); | 627 | const QColorGroup &cg = colorGroup(); |
629 | 628 | ||
630 | p->save(); | 629 | p->save(); |
631 | 630 | ||
632 | //qWarning( "Paint row: %d", row ); | 631 | //qWarning( "Paint row: %d", row ); |
633 | 632 | ||
634 | OContact act_contact = m_viewList[row]; | 633 | Opie::OPimContact act_contact = m_viewList[row]; |
635 | 634 | ||
636 | // Paint alternating background bars | 635 | // Paint alternating background bars |
637 | if ( (row % 2 ) == 0 ) { | 636 | if ( (row % 2 ) == 0 ) { |
638 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); | 637 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); |
639 | p->setPen( QPen( cg.text() ) ); | 638 | p->setPen( QPen( cg.text() ) ); |
640 | } | 639 | } |
@@ -681,13 +680,13 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
681 | 680 | ||
682 | void AbTable::rowHeightChanged( int row ) | 681 | void AbTable::rowHeightChanged( int row ) |
683 | { | 682 | { |
684 | if ( enablePainting ) | 683 | if ( enablePainting ) |
685 | QTable::rowHeightChanged( row ); | 684 | QTable::rowHeightChanged( row ); |
686 | } | 685 | } |
687 | ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) | 686 | ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) |
688 | { | 687 | { |
689 | 688 | ||
690 | ContactItem item; | 689 | ContactItem item; |
691 | 690 | ||
692 | item.value = ""; | 691 | item.value = ""; |
693 | 692 | ||