summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index b8127e9..e333b17 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -501,212 +501,214 @@ void AbTable::itemClicked(int,int col)
}
}
QStringList AbTable::choiceNames() const
{
return choicenames;
}
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);
if ( text(row,2) == selname ) {
r.append(c->email);
}
}
*/
return r;
}
void AbTable::updateVisible()
{
int visible,
totalRows,
row,
selectedRow = 0;
visible = 0;
realignTable();
setPaintingEnabled( FALSE );
totalRows = numRows();
for ( row = 0; row < totalRows; row++ ) {
if ( rowHeight(row) == 0 ) {
showRow( row );
adjustRow( row );
if ( isSelected( row,0 ) || isSelected( row,1 ) )
selectedRow = row;
}
visible++;
}
if ( selectedRow )
setCurrentCell( selectedRow, 0 );
if ( !visible )
setCurrentCell( -1, 0 );
setPaintingEnabled( TRUE );
}
void AbTable::setPaintingEnabled( bool e )
{
if ( e != enablePainting ) {
if ( !enablePainting ) {
enablePainting = true;
rowHeightChanged( 0 );
viewport()->update();
} else {
enablePainting = false;
}
}
}
void AbTable::rowHeightChanged( int row )
{
if ( enablePainting )
QTable::rowHeightChanged( row );
}
QString AbTable::findContactContact( const OContact &entry, int /* row */ )
{
QString value;
value = "";
for ( QValueList<int>::ConstIterator it = intFields.begin();
it != intFields.end(); ++it ) {
switch ( *it ) {
default:
break;
case Qtopia::Title:
value = entry.title();
break;
case Qtopia::Suffix:
value = entry.suffix();
break;
case Qtopia::FileAs:
value = entry.fileAs();
break;
case Qtopia::DefaultEmail:
value = entry.defaultEmail();
case Qtopia::Emails:
value = entry.emails();
break;
case Qtopia::HomeStreet:
value = entry.homeStreet();
break;
case Qtopia::HomeCity:
value = entry.homeCity();
break;
case Qtopia::HomeState:
value = entry.homeState();
break;
case Qtopia::HomeZip:
value = entry.homeZip();
break;
case Qtopia::HomeCountry:
value = entry.homeCountry();
break;
case Qtopia::HomePhone:
value = entry.homePhone();
break;
case Qtopia::HomeFax:
value = entry.homeFax();
break;
case Qtopia::HomeMobile:
value = entry.homeMobile();
break;
case Qtopia::HomeWebPage:
value = entry.homeWebpage();
break;
case Qtopia::Company:
value = entry.company();
break;
case Qtopia::BusinessCity:
value = entry.businessCity();
break;
case Qtopia::BusinessStreet:
value = entry.businessStreet();
break;
case Qtopia::BusinessZip:
value = entry.businessZip();
break;
case Qtopia::BusinessCountry:
value = entry.businessCountry();
break;
case Qtopia::BusinessWebPage:
value = entry.businessWebpage();
break;
case Qtopia::JobTitle:
value = entry.jobTitle();
break;
case Qtopia::Department:
value = entry.department();
break;
case Qtopia::Office:
value = entry.office();
break;
case Qtopia::BusinessPhone:
value = entry.businessPhone();
break;
case Qtopia::BusinessFax:
value = entry.businessFax();
break;
case Qtopia::BusinessMobile:
value = entry.businessMobile();
break;
case Qtopia::BusinessPager:
value = entry.businessPager();
break;
case Qtopia::Profession:
value = entry.profession();
break;
case Qtopia::Assistant:
value = entry.assistant();
break;
case Qtopia::Manager:
value = entry.manager();
break;
case Qtopia::Spouse:
value = entry.spouse();
break;
case Qtopia::Gender:
value = entry.gender();
break;
case Qtopia::Birthday:
- value = TimeString::numberDateString( entry.birthday() );
+ if ( ! entry.birthday().isNull() )
+ value = TimeString::numberDateString( entry.birthday() );
break;
case Qtopia::Anniversary:
- value = TimeString::numberDateString( entry.anniversary() );
+ if ( ! entry.anniversary().isNull() )
+ value = TimeString::numberDateString( entry.anniversary() );
break;
case Qtopia::Nickname:
value = entry.nickname();
break;
case Qtopia::Children:
value = entry.children();
break;
case Qtopia::Notes:
value = entry.notes();
break;
}
if ( !value.isEmpty() )
break;
}
return value;
}