summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp25
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
@@ -11,30 +11,29 @@
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
+#include <opie2/opimrecordlist.h>
+
#include <qpe/timestring.h>
#include <qpe/resource.h>
-#include <opie/orecordlist.h>
-
-
#include "abtable.h"
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h> //toupper() for key hack
#if 0
/*!
@@ -142,35 +141,35 @@ void AbTable::init()
{
// :SX showChar = '\0';
setNumRows( 0 );
setNumCols( 2 );
horizontalHeader()->setLabel( 0, tr( "Full Name" ));
horizontalHeader()->setLabel( 1, tr( "Contact" ));
setLeftMargin( 0 );
verticalHeader()->hide();
columnVisible = true;
}
-void AbTable::setContacts( const OContactAccess::List& viewList )
+void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList )
{
qWarning("AbTable::setContacts()");
clear();
m_viewList = 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 );
// resort();
updateVisible();
setPaintingEnabled( TRUE );
@@ -178,25 +177,25 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
}
void AbTable::setOrderedList( const QValueList<int> ordered )
{
intFields = ordered;
}
bool AbTable::selectContact( int UID )
{
qWarning( "AbTable::selectContact( %d )", UID );
int rows = numRows();
- OContact* foundContact = 0l;
+ Opie::OPimContact* foundContact = 0l;
bool found = false;
setPaintingEnabled( FALSE );
qWarning( "search start" );
for ( int r = 0; r < rows; ++r ) {
if ( m_viewList.uidAt( r ) == UID ){
ensureCellVisible( r, 0 );
setCurrentCell( r, 0 );
found = true;
break;
}
}
@@ -204,27 +203,27 @@ bool AbTable::selectContact( int UID )
if ( !found ){
ensureCellVisible( 0,0 );
setCurrentCell( 0, 0 );
}
setPaintingEnabled( TRUE );
return true;
}
#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 );
contactList.insert( ati, cnt );
setItem( row, 0, ati );
ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName);
if ( !contactItem.icon.isNull() )
@@ -263,25 +262,25 @@ void AbTable::resort()
setPaintingEnabled( FALSE );
if ( sorting() ) {
if ( lastSortCol == -1 )
lastSortCol = 0;
sortColumn( lastSortCol, asc, TRUE );
//QMessageBox::information( this, "resort", "resort" );
updateVisible();
}
setPaintingEnabled( TRUE );
#endif
}
-OContact AbTable::currentEntry()
+Opie::OPimContact AbTable::currentEntry()
{
return m_viewList[currentRow()];
}
int AbTable::currentEntry_UID()
{
return ( currentEntry().uid() );
}
void AbTable::clear()
{
qWarning( "void AbTable::clear()" );
@@ -385,25 +384,25 @@ void AbTable::moveTo( char c )
if ( first.row() || first.cell() >= c )
break;
r--;
}
}
setCurrentCell( r, currentColumn() );
#endif
}
#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
QString str;
str = entry.fileAs();
if ( str.isEmpty() ) {
str = entry.company();
if ( str.isEmpty() ) {
str = entry.defaultEmail();
}
}
return str;
}
@@ -541,25 +540,25 @@ QStringList AbTable::choiceNames() const
void AbTable::setChoiceSelection( const QValueList<int>& list )
{
intFields = list;
}
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;
}
void AbTable::updateVisible()
{
@@ -622,25 +621,25 @@ void AbTable::viewportPaintEvent( QPaintEvent* e ) {
// qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting);
if ( enablePainting )
QTable::viewportPaintEvent( e );
}
void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) {
const QColorGroup &cg = colorGroup();
p->save();
//qWarning( "Paint row: %d", row );
- OContact act_contact = m_viewList[row];
+ Opie::OPimContact act_contact = m_viewList[row];
// Paint alternating background bars
if ( (row % 2 ) == 0 ) {
p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) );
p->setPen( QPen( cg.text() ) );
}
else {
p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Background ) );
p->setPen( QPen( cg.buttonText() ) );
}
QFont f = p->font();
@@ -675,25 +674,25 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool )
}
break;
}
p->restore();
}
void AbTable::rowHeightChanged( int row )
{
if ( enablePainting )
QTable::rowHeightChanged( row );
}
-ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ )
+ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ )
{
ContactItem item;
item.value = "";
for ( QValueList<int>::ConstIterator it = intFields.begin();
it != intFields.end(); ++it ) {
switch ( *it ) {
default:
break;
case Qtopia::Title: