-rw-r--r-- | libopie/pim/ocontact.cpp | 11 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.cpp | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 9230b8b..178559b 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp @@ -463,41 +463,42 @@ QString OContact::toRichText() const + Qtopia::escapeString(defEmail) + "<br>"; text += "<hr>"; // business address if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || !businessZip().isEmpty() || !businessCountry().isEmpty() ) { text += "<br>"; text += QObject::tr( "<b>Work Address:</b>" ); text += "<br>"; marker = true; } if ( !(value = businessStreet()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; state = businessState(); + if ( !(value = businessZip()).isEmpty() ) + text += Qtopia::escapeString(value) + " "; if ( !(value = businessCity()).isEmpty() ) { text += Qtopia::escapeString(value); if ( state ) text += ", " + Qtopia::escapeString(state); text += "<br>"; } else if ( !state.isEmpty() ) text += Qtopia::escapeString(state) + "<br>"; - if ( !(value = businessZip()).isEmpty() ) - text += Qtopia::escapeString(value) + "<br>"; + if ( !(value = businessCountry()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; // rest of Business data str = office(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Office: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } str = businessWebpage(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } @@ -524,41 +525,41 @@ QString OContact::toRichText() const text += "<b>" + QObject::tr("Business Pager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } // home address if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || !homeZip().isEmpty() || !homeCountry().isEmpty() ) { text += "<br>"; text += QObject::tr( "<b>Home Address:</b>" ); text += "<br>"; } if ( !(value = homeStreet()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; state = homeState(); + if ( !(value = homeZip()).isEmpty() ) + text += Qtopia::escapeString(value) + " "; if ( !(value = homeCity()).isEmpty() ) { text += Qtopia::escapeString(value); if ( !state.isEmpty() ) text += ", " + Qtopia::escapeString(state); text += "<br>"; } else if (!state.isEmpty()) text += Qtopia::escapeString(state) + "<br>"; - if ( !(value = homeZip()).isEmpty() ) - text += Qtopia::escapeString(value) + "<br>"; if ( !(value = homeCountry()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; // rest of Home data str = homeWebpage(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } str = homePhone(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Home Phone: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } @@ -620,33 +621,33 @@ QString OContact::toRichText() const if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Children: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; if ( categoryNames().count() ){ text += "<b>" + QObject::tr( "Category:") + "</b> "; text += categoryNames().join(", "); text += "<br>"; } // notes last - if ( (value = notes()) ) { + if ( !(value = notes()).isEmpty() ) { text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp index 9230b8b..178559b 100644 --- a/libopie2/opiepim/ocontact.cpp +++ b/libopie2/opiepim/ocontact.cpp @@ -463,41 +463,42 @@ QString OContact::toRichText() const + Qtopia::escapeString(defEmail) + "<br>"; text += "<hr>"; // business address if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || !businessZip().isEmpty() || !businessCountry().isEmpty() ) { text += "<br>"; text += QObject::tr( "<b>Work Address:</b>" ); text += "<br>"; marker = true; } if ( !(value = businessStreet()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; state = businessState(); + if ( !(value = businessZip()).isEmpty() ) + text += Qtopia::escapeString(value) + " "; if ( !(value = businessCity()).isEmpty() ) { text += Qtopia::escapeString(value); if ( state ) text += ", " + Qtopia::escapeString(state); text += "<br>"; } else if ( !state.isEmpty() ) text += Qtopia::escapeString(state) + "<br>"; - if ( !(value = businessZip()).isEmpty() ) - text += Qtopia::escapeString(value) + "<br>"; + if ( !(value = businessCountry()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; // rest of Business data str = office(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Office: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } str = businessWebpage(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } @@ -524,41 +525,41 @@ QString OContact::toRichText() const text += "<b>" + QObject::tr("Business Pager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } // home address if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || !homeZip().isEmpty() || !homeCountry().isEmpty() ) { text += "<br>"; text += QObject::tr( "<b>Home Address:</b>" ); text += "<br>"; } if ( !(value = homeStreet()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; state = homeState(); + if ( !(value = homeZip()).isEmpty() ) + text += Qtopia::escapeString(value) + " "; if ( !(value = homeCity()).isEmpty() ) { text += Qtopia::escapeString(value); if ( !state.isEmpty() ) text += ", " + Qtopia::escapeString(state); text += "<br>"; } else if (!state.isEmpty()) text += Qtopia::escapeString(state) + "<br>"; - if ( !(value = homeZip()).isEmpty() ) - text += Qtopia::escapeString(value) + "<br>"; if ( !(value = homeCountry()).isEmpty() ) text += Qtopia::escapeString(value) + "<br>"; // rest of Home data str = homeWebpage(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } str = homePhone(); if ( !str.isEmpty() ){ text += "<b>" + QObject::tr("Home Phone: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; marker = true; } @@ -620,33 +621,33 @@ QString OContact::toRichText() const if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Children: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; if ( categoryNames().count() ){ text += "<b>" + QObject::tr( "Category:") + "</b> "; text += categoryNames().join(", "); text += "<br>"; } // notes last - if ( (value = notes()) ) { + if ( !(value = notes()).isEmpty() ) { text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { |