summaryrefslogtreecommitdiff
authoreilers <eilers>2003-09-08 12:42:26 (UTC)
committer eilers <eilers>2003-09-08 12:42:26 (UTC)
commit913788f77c3f501778b7653317a4a6b06452961d (patch) (side-by-side diff)
treeb9393e5b7eefb87f3a421a17035b702a6b688eb7
parent7fb091e12eec52e3d73896c728fc011fe40a3eb4 (diff)
downloadopie-913788f77c3f501778b7653317a4a6b06452961d.zip
opie-913788f77c3f501778b7653317a4a6b06452961d.tar.gz
opie-913788f77c3f501778b7653317a4a6b06452961d.tar.bz2
Fixing bug #1161: No space between jobtitle and organization
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp12
-rw-r--r--libopie2/opiepim/ocontact.cpp12
2 files changed, 8 insertions, 16 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index 0f05b65..fcf3b26 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -259,397 +259,393 @@ OContact::~OContact()
*/
/*! \fn QString OContact::defaultEmail() const
Returns the default email address of the contact.
*/
/*! \fn QString OContact::emails() const
Returns the list of email address for a contact separated by ';'s in a single
string.
*/
/*! \fn QString OContact::homeStreet() const
Returns the home street address of the contact.
*/
/*! \fn QString OContact::homeCity() const
Returns the home city of the contact.
*/
/*! \fn QString OContact::homeState() const
Returns the home state of the contact.
*/
/*! \fn QString OContact::homeZip() const
Returns the home zip of the contact.
*/
/*! \fn QString OContact::homeCountry() const
Returns the home country of the contact.
*/
/*! \fn QString OContact::homePhone() const
Returns the home phone number of the contact.
*/
/*! \fn QString OContact::homeFax() const
Returns the home fax number of the contact.
*/
/*! \fn QString OContact::homeMobile() const
Returns the home mobile number of the contact.
*/
/*! \fn QString OContact::homeWebpage() const
Returns the home webpage of the contact.
*/
/*! \fn QString OContact::company() const
Returns the company for the contact.
*/
/*! \fn QString OContact::department() const
Returns the department for the contact.
*/
/*! \fn QString OContact::office() const
Returns the office for the contact.
*/
/*! \fn QString OContact::jobTitle() const
Returns the job title of the contact.
*/
/*! \fn QString OContact::profession() const
Returns the profession of the contact.
*/
/*! \fn QString OContact::assistant() const
Returns the assistant of the contact.
*/
/*! \fn QString OContact::manager() const
Returns the manager of the contact.
*/
/*! \fn QString OContact::businessStreet() const
Returns the business street address of the contact.
*/
/*! \fn QString OContact::businessCity() const
Returns the business city of the contact.
*/
/*! \fn QString OContact::businessState() const
Returns the business state of the contact.
*/
/*! \fn QString OContact::businessZip() const
Returns the business zip of the contact.
*/
/*! \fn QString OContact::businessCountry() const
Returns the business country of the contact.
*/
/*! \fn QString OContact::businessPhone() const
Returns the business phone number of the contact.
*/
/*! \fn QString OContact::businessFax() const
Returns the business fax number of the contact.
*/
/*! \fn QString OContact::businessMobile() const
Returns the business mobile number of the contact.
*/
/*! \fn QString OContact::businessPager() const
Returns the business pager number of the contact.
*/
/*! \fn QString OContact::businessWebpage() const
Returns the business webpage of the contact.
*/
/*! \fn QString OContact::spouse() const
Returns the spouse of the contact.
*/
/*! \fn QString OContact::gender() const
Returns the gender of the contact.
*/
/*! \fn QString OContact::nickname() const
Returns the nickname of the contact.
*/
/*! \fn QString OContact::children() const
Returns the children of the contact.
*/
/*! \fn QString OContact::notes() const
Returns the notes relating to the the contact.
*/
/*! \fn QString OContact::groups() const
\internal
Returns the groups for the contact.
*/
/*! \fn QStringList OContact::groupList() const
\internal
*/
/*! \fn QString OContact::field(int) const
\internal
*/
/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null )
\internal
*/
/*! \fn void OContact::setUid( int id )
\internal
Sets the uid for this record to \a id.
*/
/*! \enum OContact::journal_action
\internal
*/
/*!
\internal
*/
QMap<int, QString> OContact::toMap() const
{
QMap<int, QString> map = mMap;
QString cats = idsToString( categories() );
if ( !cats.isEmpty() )
map.insert( Qtopia::AddressCategory, cats );
return map;
}
/*!
Returns a rich text formatted QString representing the contents the contact.
*/
QString OContact::toRichText() const
{
QString text;
QString value, comp, state;
QString str;
bool marker = false;
Config cfg("qpe");
cfg.setGroup("Appearance");
int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );
// name, jobtitle and company
if ( !(value = fullName()).isEmpty() )
text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>";
if ( !(value = jobTitle()).isEmpty() )
- text += Qtopia::escapeString(value);
+ text += Qtopia::escapeString(value) + " ";
comp = company();
if ( !(value = department()).isEmpty() ) {
text += Qtopia::escapeString(value);
if ( comp )
- text += ", ";
- else
- text += "<br>";
- }
- if ( !comp.isEmpty() )
- text += Qtopia::escapeString(comp);
-
+ text += ", " + Qtopia::escapeString(comp);
+ }else if ( comp )
+ text += "<br>" + Qtopia::escapeString(comp);
text += "<br><hr>";
// defailt email
QString defEmail = defaultEmail();
if ( !defEmail.isEmpty() ){
text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
+ Qtopia::escapeString(defEmail);
marker = true;
}
// business address
if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
!businessZip().isEmpty() || !businessCountry().isEmpty() ) {
text += QObject::tr( "<br><b>Work Address:</b>" );
marker = true;
}
if ( !(value = businessStreet()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
switch( addressformat ){
case Zip_City_State:{ // Zip_Code City, State
state = businessState();
if ( !(value = businessZip()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value) + " ";
marker = true;
}
if ( !(value = businessCity()).isEmpty() ) {
marker = true;
if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
break;
}
case City_State_Zip:{ // City, State Zip_Code
state = businessState();
if ( !(value = businessCity()).isEmpty() ) {
marker = true;
text += "<br>" + Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
if ( !(value = businessZip()).isEmpty() ){
text += " " + Qtopia::escapeString(value);
marker = true;
}
break;
}
}
if ( !(value = businessCountry()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
// rest of Business data
str = office();
if ( !str.isEmpty() ){
text += "<br><b>" + QObject::tr("Office: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessWebpage();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessPhone();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessFax();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessMobile();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessPager();
if ( !str.isEmpty() ){
text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
// text += "<br>";
// home address
if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
!homeZip().isEmpty() || !homeCountry().isEmpty() ) {
text += QObject::tr( "<br><b>Home Address:</b>" );
marker = true;
}
if ( !(value = homeStreet()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
switch( addressformat ){
case Zip_City_State:{ // Zip_Code City, State
state = homeState();
if ( !(value = homeZip()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value) + " ";
marker = true;
}
if ( !(value = homeCity()).isEmpty() ) {
marker = true;
if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString(value);
if ( !state.isEmpty() )
text += ", " + Qtopia::escapeString(state);
} else if (!state.isEmpty()) {
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
break;
}
case City_State_Zip:{ // City, State Zip_Code
state = homeState();
if ( !(value = homeCity()).isEmpty() ) {
marker = true;
text += "<br>" + Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
if ( !(value = homeZip()).isEmpty() ){
text += " " + Qtopia::escapeString(value);
marker = true;
}
break;
}
}
if ( !(value = homeCountry()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
// rest of Home data
str = homeWebpage();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homePhone();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homeFax();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homeMobile();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
if ( marker )
text += "<br><hr>";
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index 0f05b65..fcf3b26 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -259,397 +259,393 @@ OContact::~OContact()
*/
/*! \fn QString OContact::defaultEmail() const
Returns the default email address of the contact.
*/
/*! \fn QString OContact::emails() const
Returns the list of email address for a contact separated by ';'s in a single
string.
*/
/*! \fn QString OContact::homeStreet() const
Returns the home street address of the contact.
*/
/*! \fn QString OContact::homeCity() const
Returns the home city of the contact.
*/
/*! \fn QString OContact::homeState() const
Returns the home state of the contact.
*/
/*! \fn QString OContact::homeZip() const
Returns the home zip of the contact.
*/
/*! \fn QString OContact::homeCountry() const
Returns the home country of the contact.
*/
/*! \fn QString OContact::homePhone() const
Returns the home phone number of the contact.
*/
/*! \fn QString OContact::homeFax() const
Returns the home fax number of the contact.
*/
/*! \fn QString OContact::homeMobile() const
Returns the home mobile number of the contact.
*/
/*! \fn QString OContact::homeWebpage() const
Returns the home webpage of the contact.
*/
/*! \fn QString OContact::company() const
Returns the company for the contact.
*/
/*! \fn QString OContact::department() const
Returns the department for the contact.
*/
/*! \fn QString OContact::office() const
Returns the office for the contact.
*/
/*! \fn QString OContact::jobTitle() const
Returns the job title of the contact.
*/
/*! \fn QString OContact::profession() const
Returns the profession of the contact.
*/
/*! \fn QString OContact::assistant() const
Returns the assistant of the contact.
*/
/*! \fn QString OContact::manager() const
Returns the manager of the contact.
*/
/*! \fn QString OContact::businessStreet() const
Returns the business street address of the contact.
*/
/*! \fn QString OContact::businessCity() const
Returns the business city of the contact.
*/
/*! \fn QString OContact::businessState() const
Returns the business state of the contact.
*/
/*! \fn QString OContact::businessZip() const
Returns the business zip of the contact.
*/
/*! \fn QString OContact::businessCountry() const
Returns the business country of the contact.
*/
/*! \fn QString OContact::businessPhone() const
Returns the business phone number of the contact.
*/
/*! \fn QString OContact::businessFax() const
Returns the business fax number of the contact.
*/
/*! \fn QString OContact::businessMobile() const
Returns the business mobile number of the contact.
*/
/*! \fn QString OContact::businessPager() const
Returns the business pager number of the contact.
*/
/*! \fn QString OContact::businessWebpage() const
Returns the business webpage of the contact.
*/
/*! \fn QString OContact::spouse() const
Returns the spouse of the contact.
*/
/*! \fn QString OContact::gender() const
Returns the gender of the contact.
*/
/*! \fn QString OContact::nickname() const
Returns the nickname of the contact.
*/
/*! \fn QString OContact::children() const
Returns the children of the contact.
*/
/*! \fn QString OContact::notes() const
Returns the notes relating to the the contact.
*/
/*! \fn QString OContact::groups() const
\internal
Returns the groups for the contact.
*/
/*! \fn QStringList OContact::groupList() const
\internal
*/
/*! \fn QString OContact::field(int) const
\internal
*/
/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null )
\internal
*/
/*! \fn void OContact::setUid( int id )
\internal
Sets the uid for this record to \a id.
*/
/*! \enum OContact::journal_action
\internal
*/
/*!
\internal
*/
QMap<int, QString> OContact::toMap() const
{
QMap<int, QString> map = mMap;
QString cats = idsToString( categories() );
if ( !cats.isEmpty() )
map.insert( Qtopia::AddressCategory, cats );
return map;
}
/*!
Returns a rich text formatted QString representing the contents the contact.
*/
QString OContact::toRichText() const
{
QString text;
QString value, comp, state;
QString str;
bool marker = false;
Config cfg("qpe");
cfg.setGroup("Appearance");
int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );
// name, jobtitle and company
if ( !(value = fullName()).isEmpty() )
text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>";
if ( !(value = jobTitle()).isEmpty() )
- text += Qtopia::escapeString(value);
+ text += Qtopia::escapeString(value) + " ";
comp = company();
if ( !(value = department()).isEmpty() ) {
text += Qtopia::escapeString(value);
if ( comp )
- text += ", ";
- else
- text += "<br>";
- }
- if ( !comp.isEmpty() )
- text += Qtopia::escapeString(comp);
-
+ text += ", " + Qtopia::escapeString(comp);
+ }else if ( comp )
+ text += "<br>" + Qtopia::escapeString(comp);
text += "<br><hr>";
// defailt email
QString defEmail = defaultEmail();
if ( !defEmail.isEmpty() ){
text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
+ Qtopia::escapeString(defEmail);
marker = true;
}
// business address
if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
!businessZip().isEmpty() || !businessCountry().isEmpty() ) {
text += QObject::tr( "<br><b>Work Address:</b>" );
marker = true;
}
if ( !(value = businessStreet()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
switch( addressformat ){
case Zip_City_State:{ // Zip_Code City, State
state = businessState();
if ( !(value = businessZip()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value) + " ";
marker = true;
}
if ( !(value = businessCity()).isEmpty() ) {
marker = true;
if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
break;
}
case City_State_Zip:{ // City, State Zip_Code
state = businessState();
if ( !(value = businessCity()).isEmpty() ) {
marker = true;
text += "<br>" + Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
if ( !(value = businessZip()).isEmpty() ){
text += " " + Qtopia::escapeString(value);
marker = true;
}
break;
}
}
if ( !(value = businessCountry()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
// rest of Business data
str = office();
if ( !str.isEmpty() ){
text += "<br><b>" + QObject::tr("Office: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessWebpage();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessPhone();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessFax();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessMobile();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = businessPager();
if ( !str.isEmpty() ){
text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
// text += "<br>";
// home address
if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
!homeZip().isEmpty() || !homeCountry().isEmpty() ) {
text += QObject::tr( "<br><b>Home Address:</b>" );
marker = true;
}
if ( !(value = homeStreet()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
switch( addressformat ){
case Zip_City_State:{ // Zip_Code City, State
state = homeState();
if ( !(value = homeZip()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value) + " ";
marker = true;
}
if ( !(value = homeCity()).isEmpty() ) {
marker = true;
if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString(value);
if ( !state.isEmpty() )
text += ", " + Qtopia::escapeString(state);
} else if (!state.isEmpty()) {
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
break;
}
case City_State_Zip:{ // City, State Zip_Code
state = homeState();
if ( !(value = homeCity()).isEmpty() ) {
marker = true;
text += "<br>" + Qtopia::escapeString(value);
if ( state )
text += ", " + Qtopia::escapeString(state);
} else if ( !state.isEmpty() ){
text += "<br>" + Qtopia::escapeString(state);
marker = true;
}
if ( !(value = homeZip()).isEmpty() ){
text += " " + Qtopia::escapeString(value);
marker = true;
}
break;
}
}
if ( !(value = homeCountry()).isEmpty() ){
text += "<br>" + Qtopia::escapeString(value);
marker = true;
}
// rest of Home data
str = homeWebpage();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homePhone();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homeFax();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
str = homeMobile();
if ( !str.isEmpty() ){
text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
+ Qtopia::escapeString(str);
marker = true;
}
if ( marker )
text += "<br><hr>";