summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
authordrw <drw>2004-04-02 20:16:47 (UTC)
committer drw <drw>2004-04-02 20:16:47 (UTC)
commitb4d07df7854800fd3613034f54488c6fa27d94ee (patch) (side-by-side diff)
treee467a97fe4fe9dd0d96dd22299195dd30227bef1 /core/pim/addressbook/abtable.cpp
parent97bdc55663590ba430a4f322ad97aab9f4c02bf3 (diff)
downloadopie-b4d07df7854800fd3613034f54488c6fa27d94ee.zip
opie-b4d07df7854800fd3613034f54488c6fa27d94ee.tar.gz
opie-b4d07df7854800fd3613034f54488c6fa27d94ee.tar.bz2
Use ODebug (135 down...), and remove libopiedb2 from dependencies
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp57
1 files changed, 30 insertions, 27 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index cd77b13..cb57342 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -16,13 +16,13 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
-
+#include <opie2/odebug.h>
#include <opie2/opimrecordlist.h>
#include <qpe/timestring.h>
#include <qpe/resource.h>
#include "abtable.h"
@@ -118,22 +118,21 @@ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name
asc( TRUE ),
intFields( order ),
enablePainting( true ),
columnVisible( true ),
countNested( 0 )
{
- // qWarning("C'tor start");
-
+ // Opie::Core::owarn << "C'tor start" << oendl;
setSelectionMode( NoSelection );
init();
setSorting( TRUE );
connect( this, SIGNAL(clicked(int,int,int,const QPoint&)),
this, SLOT(itemClicked(int,int)) );
// contactList.clear();
- // qWarning("C'tor end");
+ // Opie::Core::owarn << "C'tor end" << oendl;
}
AbTable::~AbTable()
{
}
@@ -149,13 +148,13 @@ void AbTable::init()
verticalHeader()->hide();
columnVisible = true;
}
void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList )
{
- qWarning("AbTable::setContacts()");
+ Opie::Core::owarn << "AbTable::setContacts()" << oendl;
clear();
m_viewList = viewList;
setSorting( false );
setPaintingEnabled( FALSE );
@@ -181,28 +180,28 @@ void AbTable::setOrderedList( const QValueList<int> ordered )
intFields = ordered;
}
bool AbTable::selectContact( int UID )
{
- qWarning( "AbTable::selectContact( %d )", UID );
+ Opie::Core::owarn << "AbTable::selectContact( " << UID << " )" << oendl;
int rows = numRows();
Opie::OPimContact* foundContact = 0l;
bool found = false;
setPaintingEnabled( FALSE );
- qWarning( "search start" );
+ Opie::Core::owarn << "Search start" << oendl;
for ( int r = 0; r < rows; ++r ) {
if ( m_viewList.uidAt( r ) == UID ){
ensureCellVisible( r, 0 );
setCurrentCell( r, 0 );
found = true;
break;
}
}
- qWarning( "search end" );
+ Opie::Core::owarn << "Search end" << oendl;
if ( !found ){
ensureCellVisible( 0,0 );
setCurrentCell( 0, 0 );
}
@@ -211,13 +210,14 @@ bool AbTable::selectContact( int UID )
return true;
}
#if 0
void AbTable::insertIntoTable( const Opie::OPimContact& cnt, int row )
{
- qWarning( "void AbTable::insertIntoTable( const Opie::OPimContact& cnt, %d )", row );
+ Opie::Core::owarn << "void AbTable::insertIntoTable( const Opie::OPimContact& cnt, "
+ << row << " )" << oendl;
QString strName;
ContactItem contactItem;
strName = findContactName( cnt );
contactItem = findContactContact( cnt, row );
@@ -254,13 +254,13 @@ void AbTable::columnClicked( int col )
//QMessageBox::information( this, "resort", "columnClicked" );
resort();
}
void AbTable::resort()
{
- qWarning( "void AbTable::resort() NOT POSSIBLE !!" );
+ Opie::Core::owarn << "void AbTable::resort() NOT POSSIBLE !!" << oendl;
#if 0
setPaintingEnabled( FALSE );
if ( sorting() ) {
if ( lastSortCol == -1 )
lastSortCol = 0;
sortColumn( lastSortCol, asc, TRUE );
@@ -280,13 +280,13 @@ int AbTable::currentEntry_UID()
{
return ( currentEntry().uid() );
}
void AbTable::clear()
{
- qWarning( "void AbTable::clear()" );
+ Opie::Core::owarn << "void AbTable::clear()" << oendl;
// contactList.clear();
setPaintingEnabled( FALSE );
for ( int r = 0; r < numRows(); ++r ) {
for ( int c = 0; c < numCols(); ++c ) {
if ( cellWidget( r, c ) )
@@ -298,13 +298,13 @@ void AbTable::clear()
setPaintingEnabled( TRUE );
}
// Refresh updates column 2 if the contactsettings changed
void AbTable::refresh()
{
- qWarning( "void AbTable::refresh() NOT IMPLEMENTED !!" );
+ Opie::Core::owarn << "void AbTable::refresh() NOT IMPLEMENTED !!" << oendl;
#if 0
int rows = numRows();
AbTableItem *abi;
ContactItem contactItem;
@@ -331,36 +331,36 @@ void AbTable::keyPressEvent( QKeyEvent *e )
{
char key = toupper( e->ascii() );
if ( key >= 'A' && key <= 'Z' )
moveTo( key );
- // qWarning("Received key ..");
+ // Opie::Core::owarn << "Received key .." << oendl;
switch( e->key() ) {
case Qt::Key_Space:
case Qt::Key_Return:
case Qt::Key_Enter:
emit signalSwitch();
break;
// case Qt::Key_Up:
-// qWarning("a");
+// Opie::Core::owarn << "a" << oendl;
// emit signalKeyUp();
// break;
// case Qt::Key_Down:
-// qWarning("b");
+// Opie::Core::owarn << "b" << oendl;
// emit signalKeyDown();
// break;
default:
QTable::keyPressEvent( e );
}
}
void AbTable::moveTo( char c )
{
- qWarning( "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" );
+ Opie::Core::owarn << "void AbTable::moveTo( char c ) NOT IMPLEMENTED !!" << oendl;
#if 0
int rows = numRows();
QString value;
AbTableItem *abi;
int r;
@@ -420,13 +420,13 @@ void AbTable::resizeRows() {
*/
}
void AbTable::realignTable()
{
- // qWarning( "void AbTable::realignTable()" );
+ // Opie::Core::owarn << "void AbTable::realignTable()" << oendl;
setPaintingEnabled( FALSE );
resizeRows();
fitColumns();
@@ -470,37 +470,37 @@ void QTable::paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch )
// }
void AbTable::fitColumns()
{
- qWarning( "void AbTable::fitColumns()" );
+ Opie::Core::owarn << "void AbTable::fitColumns()" << oendl;
int contentsWidth = visibleWidth() / 2;
// Fix to better value
// contentsWidth = 130;
setPaintingEnabled( FALSE );
if ( columnVisible == false ){
showColumn(0);
columnVisible = true;
}
- // qWarning("Width: %d", contentsWidth);
+ // Opie::Core::owarn << "Width: " << contentsWidth << oendl;
setColumnWidth( 0, contentsWidth );
adjustColumn(1);
if ( columnWidth(1) < contentsWidth )
setColumnWidth( 1, contentsWidth );
setPaintingEnabled( TRUE );
}
void AbTable::show()
{
- // qWarning( "void AbTable::show()" );
+ // Opie::Core::owarn << "void AbTable::show()" << oendl;
realignTable();
QTable::show();
}
#if 0
void AbTable::setChoiceNames( const QStringList& list)
@@ -518,17 +518,17 @@ void AbTable::setChoiceNames( const QStringList& list)
fitColumns();
}
#endif
void AbTable::itemClicked(int,int col)
{
- // qWarning( "AbTable::itemClicked(int, col:%d)", col);
+ // Opie::Core::owarn << "AbTable::itemClicked(int, col: " << col << ")" << oendl;
if ( col == 2 ) {
return;
} else {
- // qWarning ("Emitting signalSwitch()");
+ // Opie::Core::owarn << "Emitting signalSwitch()" << oendl;
emit signalSwitch();
}
}
#if 0
QStringList AbTable::choiceNames() const
@@ -559,13 +559,13 @@ QStringList AbTable::choiceSelection(int /*index*/) const
return r;
}
void AbTable::updateVisible()
{
- // qWarning("void AbTable::updateVisible()");
+ // Opie::Core::owarn << "void AbTable::updateVisible()" << oendl;
int visible,
totalRows,
row,
selectedRow = 0;
@@ -595,13 +595,14 @@ void AbTable::updateVisible()
setPaintingEnabled( TRUE );
}
void AbTable::setPaintingEnabled( bool e )
{
- // qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
+ // Opie::Core::owarn << "IN void AbTable::setPaintingEnabled( " << e << " )->Nested: "
+ // << countNested << oendl;
if ( e ) {
if ( countNested > 0 )
--countNested;
if ( ! countNested ){
setUpdatesEnabled( true );
@@ -611,27 +612,29 @@ void AbTable::setPaintingEnabled( bool e )
}
} else {
++countNested;
enablePainting = false;
setUpdatesEnabled( false );
}
- // qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
+ // Opie::Core::owarn << "OUT void AbTable::setPaintingEnabled( " << e << " )->Nested: "
+ // << countNested << oendl;
}
void AbTable::viewportPaintEvent( QPaintEvent* e ) {
- // qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting);
+ // Opie::Core::owarn << "void AbTable::viewportPaintEvent( QPaintEvent* e ) -> "
+ // << enablePainting << oendl;
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 );
+ // Opie::Core::owarn << "Paint row: " << row << oendl;
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 ) );