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 @@ -21,10 +21,9 @@ +#include <opie2/opimrecordlist.h> + #include <qpe/timestring.h> #include <qpe/resource.h> -#include <opie/orecordlist.h> - - #include "abtable.h" @@ -40,5 +39,5 @@ /*! \class AbTableItem abtable.h - + \brief QTableItem based class for showing a field of an entry */ @@ -67,5 +66,5 @@ void AbTableItem::setItem( const QString &txt, const QString &secondKey ) setText( txt ); sortKey = Qtopia::buildSortKey( txt, secondKey ); - + // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); } @@ -73,5 +72,5 @@ void AbTableItem::setItem( const QString &txt, const QString &secondKey ) /*! \class AbPickItem abtable.h - + \brief QTableItem based class for showing slection of an entry */ @@ -110,5 +109,5 @@ void AbPickItem::setContentFromEditor( QWidget *w ) /*! \class AbTable abtable.h - + \brief QTable based class for showing a list of entries */ @@ -144,5 +143,5 @@ void AbTable::init() setNumRows( 0 ); setNumCols( 2 ); - + horizontalHeader()->setLabel( 0, tr( "Full Name" )); horizontalHeader()->setLabel( 1, tr( "Contact" )); @@ -152,5 +151,5 @@ void AbTable::init() } -void AbTable::setContacts( const OContactAccess::List& viewList ) +void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) { qWarning("AbTable::setContacts()"); @@ -161,11 +160,11 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) setSorting( false ); setPaintingEnabled( FALSE ); - - OContactAccess::List::Iterator it; + + Opie::OPimContactAccess::List::Iterator it; setNumRows( m_viewList.count() ); // int row = 0; // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) // insertIntoTable( *it, row++ ); - + // setSorting( true ); @@ -188,5 +187,5 @@ bool AbTable::selectContact( int UID ) qWarning( "AbTable::selectContact( %d )", UID ); int rows = numRows(); - OContact* foundContact = 0l; + Opie::OPimContact* foundContact = 0l; bool found = false; @@ -214,13 +213,13 @@ bool AbTable::selectContact( int UID ) #if 0 -void AbTable::insertIntoTable( const OContact& cnt, int row ) +void AbTable::insertIntoTable( const Opie::OPimContact& cnt, int row ) { - qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); + qWarning( "void AbTable::insertIntoTable( const Opie::OPimContact& cnt, %d )", row ); QString strName; ContactItem contactItem; - + strName = findContactName( cnt ); contactItem = findContactContact( cnt, row ); - + AbTableItem *ati; ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value ); @@ -231,8 +230,8 @@ void AbTable::insertIntoTable( const OContact& cnt, int row ) ati->setPixmap( contactItem.icon ); setItem( row, 1, ati ); - + //### cannot do this; table only has two columns at this point // setItem( row, 2, new AbPickItem( this ) ); - + } #endif @@ -243,8 +242,8 @@ void AbTable::columnClicked( int col ) if ( !sorting() ) return; - + if ( lastSortCol == -1 ) lastSortCol = col; - + if ( col == lastSortCol ) { asc = !asc; @@ -273,6 +272,6 @@ void AbTable::resort() } -OContact AbTable::currentEntry() -{ +Opie::OPimContact AbTable::currentEntry() +{ return m_viewList[currentRow()]; } @@ -332,8 +331,8 @@ void AbTable::keyPressEvent( QKeyEvent *e ) { char key = toupper( e->ascii() ); - + if ( key >= 'A' && key <= 'Z' ) moveTo( key ); - + // qWarning("Received key .."); switch( e->key() ) { @@ -354,5 +353,5 @@ void AbTable::keyPressEvent( QKeyEvent *e ) QTable::keyPressEvent( e ); } - + } @@ -360,5 +359,5 @@ void AbTable::moveTo( char c ) { qWarning( "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" ); - + #if 0 int rows = numRows(); @@ -395,5 +394,5 @@ void AbTable::moveTo( char c ) #if 0 // Useless.. Nobody uses it .. (se) -QString AbTable::findContactName( const OContact &entry ) +QString AbTable::findContactName( const Opie::OPimContact &entry ) { // We use the fileAs, then company, defaultEmail @@ -476,15 +475,15 @@ void AbTable::fitColumns() { qWarning( "void AbTable::fitColumns()" ); - int contentsWidth = visibleWidth() / 2; + int contentsWidth = visibleWidth() / 2; // Fix to better value - // contentsWidth = 130; + // contentsWidth = 130; setPaintingEnabled( FALSE ); - + if ( columnVisible == false ){ showColumn(0); columnVisible = true; } - + // qWarning("Width: %d", contentsWidth); @@ -548,13 +547,13 @@ QStringList AbTable::choiceSelection(int /*index*/) const QStringList r; /* ###### - + QString selname = choicenames.at(index); for (each row) { - OContact *c = contactForRow(row); + Opie::OPimContact *c = contactForRow(row); if ( text(row,2) == selname ) { r.append(c->email); } } - + */ return r; @@ -570,7 +569,7 @@ void AbTable::updateVisible() row, selectedRow = 0; - + visible = 0; - + setPaintingEnabled( FALSE ); @@ -593,5 +592,5 @@ void AbTable::updateVisible() if ( !visible ) setCurrentCell( -1, 0 ); - + setPaintingEnabled( TRUE ); } @@ -632,5 +631,5 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) //qWarning( "Paint row: %d", row ); - OContact act_contact = m_viewList[row]; + Opie::OPimContact act_contact = m_viewList[row]; // Paint alternating background bars @@ -654,5 +653,5 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) switch( col ){ - case 0: + case 0: p->drawText( x + marg,2 + fm.ascent(), nameText ); break; @@ -662,9 +661,9 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) QPixmap contactPic = contactItem.icon; /* pixmap( row, col ); */ QString contactText = contactItem.value; - + if ( !contactPic.isNull() ) { p->drawPixmap( x + marg, y, contactPic ); - p->drawText( x + marg + contactPic.width() + p->drawText( x + marg + contactPic.width() + 4,2 + fm.ascent(), contactText ); } @@ -685,5 +684,5 @@ void AbTable::rowHeightChanged( int row ) QTable::rowHeightChanged( row ); } -ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) +ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) { |