author | eilers <eilers> | 2002-10-08 12:33:52 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-08 12:33:52 (UTC) |
commit | a194611bf645fe7e2e9e83733ababc587fd42f1d (patch) (side-by-side diff) | |
tree | 2c21a5576bce48dba2fe83f6c849c0d16025a848 /core/pim/addressbook/abeditor.cpp | |
parent | 333fec32d47ea32de9fb4c8cd378a519785a1ff8 (diff) | |
download | opie-a194611bf645fe7e2e9e83733ababc587fd42f1d.zip opie-a194611bf645fe7e2e9e83733ababc587fd42f1d.tar.gz opie-a194611bf645fe7e2e9e83733ababc587fd42f1d.tar.bz2 |
Joined development branch: It uses the new PIM API
Some features in "View" added by Darwin Zins, but they are
not finished..
Diffstat (limited to 'core/pim/addressbook/abeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abeditor.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/pim/addressbook/abeditor.cpp b/core/pim/addressbook/abeditor.cpp index 6354db9..91e8722 100644 --- a/core/pim/addressbook/abeditor.cpp +++ b/core/pim/addressbook/abeditor.cpp @@ -42,25 +42,25 @@ static inline bool constainsWhiteSpace( const QString &str ); // helper functions, convert our comma delimited list to proper // file format... void parseEmailFrom( const QString &txt, QString &strDefaultEmail, QString &strAll ); // helper convert from file format to comma delimited... void parseEmailTo( const QString &strDefaultEmail, const QString &strOtherEmail, QString &strBack ); -AbEditor::AbEditor( const Contact &entry, const QValueList<int> *newOrdered, +AbEditor::AbEditor( const OContact &entry, const QValueList<int> *newOrdered, QStringList *slNewOrdered, QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ) : QDialog( parent, name, TRUE, fl ), orderedValues( newOrdered ), slOrdered( slNewOrdered ) { init(); initMap(); setEntry( entry ); } AbEditor::~AbEditor() @@ -173,25 +173,25 @@ void AbEditor::initMap() */ } void AbEditor::loadFields() { QStringList::ConstIterator it; QListIterator<QLabel> lit( listName ); for ( it = slOrdered->begin(); *lit; ++lit, ++it ) { (*lit)->setText( *it ); } } -void AbEditor::setEntry( const Contact &entry ) +void AbEditor::setEntry( const OContact &entry ) { ent = entry; QListIterator<QLineEdit> it( listValue ); firstEdit->setText( ent.firstName() ); lastEdit->setText( ent.lastName() ); cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); // ### Fix... QValueList<int>::ConstIterator itVl; for ( itVl = orderedValues->begin(); *it && itVl != orderedValues->end(); ++itVl, ++it ) { switch( *itVl ) { @@ -401,30 +401,30 @@ void AbEditor::saveEntry() // // QStringList slCat = QStringList::split( ";", value ); // // QValueList<int> cat; // // for ( QStringList::ConstIterator it = slCat.begin(); // // it != slCat.end(); ++it ) // // cat.append( (*it).toInt() ); // // ent.setCategories( cat ); // } // break; // email case Qtopia::DefaultEmail: case Qtopia::Emails: - parseEmailFrom( it.current()->text(), strDefaultEmail, - strOtherEmail ); - ent.setDefaultEmail( strDefaultEmail ); - ent.setEmails( strOtherEmail ); - break; - + parseEmailFrom( it.current()->text(), strDefaultEmail, + strOtherEmail ); + ent.setDefaultEmail( strDefaultEmail ); + ent.setEmails( strOtherEmail ); + break; + // home case Qtopia::HomeStreet: ent.setHomeStreet( it.current()->text() ); break; case Qtopia::HomeCity: ent.setHomeCity( it.current()->text() ); break; case Qtopia::HomeState: ent.setHomeState( it.current()->text() ); break; case Qtopia::HomeZip: ent.setHomeZip( it.current()->text() ); @@ -540,24 +540,25 @@ void AbEditor::slotNote() void AbEditor::setNameFocus() { firstEdit->setFocus(); } void parseEmailFrom( const QString &txt, QString &strDefaultEmail, QString &strAll ) { int where, start; if ( txt.isEmpty() ) return; + // find the first where = txt.find( ',' ); if ( where < 0 ) { strDefaultEmail = txt; strAll = txt; } else { strDefaultEmail = txt.left( where ).stripWhiteSpace(); strAll = strDefaultEmail; while ( where > -1 ) { strAll.append(" "); start = where; where = txt.find( ',', where + 1 ); |