author | mickeyl <mickeyl> | 2004-02-23 13:15:42 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-23 13:15:42 (UTC) |
commit | f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf (patch) (side-by-side diff) | |
tree | 4044006e676c78370fdeccf960ea4214f13eabd2 /libopie2/opiepim/ocontactfields.cpp | |
parent | 2d37d653310da0a9d6e2e2e6c9f5bf092e54cbbb (diff) | |
download | opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.zip opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.gz opie-f9f0c26d9ac94586ffc36efa1b582ece3dbc43cf.tar.bz2 |
cosmetics
Diffstat (limited to 'libopie2/opiepim/ocontactfields.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/ocontactfields.cpp | 496 |
1 files changed, 253 insertions, 243 deletions
diff --git a/libopie2/opiepim/ocontactfields.cpp b/libopie2/opiepim/ocontactfields.cpp index deaa1e5..bec00f7 100644 --- a/libopie2/opiepim/ocontactfields.cpp +++ b/libopie2/opiepim/ocontactfields.cpp @@ -1,9 +1,9 @@ /* This file is part of the Opie Project - Copyright (C) The Main Author <main-author@whereever.org> + Copyright (C) Stefan Eilers <eilers.stefan@epost.de> =. Copyright (C) The Opie Team <opie-devel@handhelds.org> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public @@ -24,35 +24,38 @@ -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <opie2/ocontactfields.h> +#include "ocontactfields.h" -#include <qstringlist.h> +/* OPIE */ +#include <opie2/ocontact.h> +#include <qpe/recordfields.h> // We should use our own enum in the future .. +#include <qpe/config.h> + +/* QT */ #include <qobject.h> +#include <qstringlist.h> -// We should use our own enum in the future .. -#include <qpe/recordfields.h> -#include <qpe/config.h> -#include <opie2/ocontact.h> -namespace Opie { +namespace Opie +{ /*! \internal Returns a list of personal field names for a contact. */ QStringList OContactFields::personalfields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) - mapIdToStr = idToTrFields(); + mapIdToStr = idToTrFields(); else - mapIdToStr = idToUntrFields(); + mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::AddressUid ] ); list.append( mapIdToStr[ Qtopia::AddressCategory ] ); list.append( mapIdToStr[ Qtopia::Title ] ); list.append( mapIdToStr[ Qtopia::FirstName ] ); @@ -65,28 +68,28 @@ QStringList OContactFields::personalfields( bool sorted, bool translated ) list.append( mapIdToStr[ Qtopia::Department ] ); list.append( mapIdToStr[ Qtopia::Company ] ); list.append( mapIdToStr[ Qtopia::Notes ] ); list.append( mapIdToStr[ Qtopia::Groups ] ); - if (sorted) list.sort(); + if ( sorted ) list.sort(); return list; } /*! \internal Returns a list of details field names for a contact. */ QStringList OContactFields::detailsfields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) - mapIdToStr = idToTrFields(); + mapIdToStr = idToTrFields(); else - mapIdToStr = idToUntrFields(); + mapIdToStr = idToUntrFields(); list.append( mapIdToStr[ Qtopia::Office ] ); list.append( mapIdToStr[ Qtopia::Profession ] ); list.append( mapIdToStr[ Qtopia::Assistant ] ); list.append( mapIdToStr[ Qtopia::Manager ] ); @@ -94,45 +97,45 @@ QStringList OContactFields::detailsfields( bool sorted, bool translated ) list.append( mapIdToStr[ Qtopia::Gender ] ); list.append( mapIdToStr[ Qtopia::Birthday ] ); list.append( mapIdToStr[ Qtopia::Anniversary ] ); list.append( mapIdToStr[ Qtopia::Nickname ] ); list.append( mapIdToStr[ Qtopia::Children ] ); - if (sorted) list.sort(); + if ( sorted ) list.sort(); return list; } /*! \internal Returns a list of phone field names for a contact. */ QStringList OContactFields::phonefields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) - mapIdToStr = idToTrFields(); + mapIdToStr = idToTrFields(); else - mapIdToStr = idToUntrFields(); + mapIdToStr = idToUntrFields(); - list.append( mapIdToStr[Qtopia::BusinessPhone] ); - list.append( mapIdToStr[Qtopia::BusinessFax] ); - list.append( mapIdToStr[Qtopia::BusinessMobile] ); - list.append( mapIdToStr[Qtopia::BusinessPager] ); - list.append( mapIdToStr[Qtopia::BusinessWebPage] ); + list.append( mapIdToStr[ Qtopia::BusinessPhone ] ); + list.append( mapIdToStr[ Qtopia::BusinessFax ] ); + list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); + list.append( mapIdToStr[ Qtopia::BusinessPager ] ); + list.append( mapIdToStr[ Qtopia::BusinessWebPage ] ); - list.append( mapIdToStr[Qtopia::DefaultEmail] ); - list.append( mapIdToStr[Qtopia::Emails] ); + list.append( mapIdToStr[ Qtopia::DefaultEmail ] ); + list.append( mapIdToStr[ Qtopia::Emails ] ); - list.append( mapIdToStr[Qtopia::HomePhone] ); - list.append( mapIdToStr[Qtopia::HomeFax] ); - list.append( mapIdToStr[Qtopia::HomeMobile] ); + list.append( mapIdToStr[ Qtopia::HomePhone ] ); + list.append( mapIdToStr[ Qtopia::HomeFax ] ); + list.append( mapIdToStr[ Qtopia::HomeMobile ] ); // list.append( mapIdToStr[Qtopia::HomePager] ); - list.append( mapIdToStr[Qtopia::HomeWebPage] ); + list.append( mapIdToStr[ Qtopia::HomeWebPage ] ); - if (sorted) list.sort(); + if ( sorted ) list.sort(); return list; } /*! \internal @@ -140,106 +143,106 @@ QStringList OContactFields::phonefields( bool sorted, bool translated ) */ QStringList OContactFields::fields( bool sorted, bool translated ) { QStringList list; QMap<int, QString> mapIdToStr; if ( translated ) - mapIdToStr = idToTrFields(); + mapIdToStr = idToTrFields(); else - mapIdToStr = idToUntrFields(); + mapIdToStr = idToUntrFields(); list += personalfields( sorted, translated ); list += phonefields( sorted, translated ); - list.append( mapIdToStr[Qtopia::BusinessStreet] ); - list.append( mapIdToStr[Qtopia::BusinessCity] ); - list.append( mapIdToStr[Qtopia::BusinessState] ); - list.append( mapIdToStr[Qtopia::BusinessZip] ); - list.append( mapIdToStr[Qtopia::BusinessCountry] ); + list.append( mapIdToStr[ Qtopia::BusinessStreet ] ); + list.append( mapIdToStr[ Qtopia::BusinessCity ] ); + list.append( mapIdToStr[ Qtopia::BusinessState ] ); + list.append( mapIdToStr[ Qtopia::BusinessZip ] ); + list.append( mapIdToStr[ Qtopia::BusinessCountry ] ); - list.append( mapIdToStr[Qtopia::HomeStreet] ); - list.append( mapIdToStr[Qtopia::HomeCity] ); - list.append( mapIdToStr[Qtopia::HomeState] ); - list.append( mapIdToStr[Qtopia::HomeZip] ); - list.append( mapIdToStr[Qtopia::HomeCountry] ); + list.append( mapIdToStr[ Qtopia::HomeStreet ] ); + list.append( mapIdToStr[ Qtopia::HomeCity ] ); + list.append( mapIdToStr[ Qtopia::HomeState ] ); + list.append( mapIdToStr[ Qtopia::HomeZip ] ); + list.append( mapIdToStr[ Qtopia::HomeCountry ] ); list += detailsfields( sorted, translated ); - if (sorted) list.sort(); + if ( sorted ) list.sort(); return list; } /*! \internal Returns an untranslated list of personal field names for a contact. */ QStringList OContactFields::untrpersonalfields( bool sorted ) { - return personalfields( sorted, false ); + return personalfields( sorted, false ); } /*! \internal Returns a translated list of personal field names for a contact. */ QStringList OContactFields::trpersonalfields( bool sorted ) { - return personalfields( sorted, true ); + return personalfields( sorted, true ); } /*! \internal Returns an untranslated list of details field names for a contact. */ QStringList OContactFields::untrdetailsfields( bool sorted ) { - return detailsfields( sorted, false ); + return detailsfields( sorted, false ); } /*! \internal Returns a translated list of details field names for a contact. */ QStringList OContactFields::trdetailsfields( bool sorted ) { - return detailsfields( sorted, true ); + return detailsfields( sorted, true ); } /*! \internal Returns a translated list of phone field names for a contact. */ QStringList OContactFields::trphonefields( bool sorted ) { - return phonefields( sorted, true ); + return phonefields( sorted, true ); } /*! \internal Returns an untranslated list of phone field names for a contact. */ QStringList OContactFields::untrphonefields( bool sorted ) { - return phonefields( sorted, false ); + return phonefields( sorted, false ); } /*! \internal Returns a translated list of field names for a contact. */ QStringList OContactFields::trfields( bool sorted ) { - return fields( sorted, true ); + return fields( sorted, true ); } /*! \internal Returns an untranslated list of field names for a contact. */ @@ -247,262 +250,269 @@ QStringList OContactFields::untrfields( bool sorted ) { return fields( sorted, false ); } QMap<int, QString> OContactFields::idToTrFields() { - QMap<int, QString> ret_map; - - ret_map.insert( Qtopia::AddressUid, QObject::tr( "User Id" ) ); - ret_map.insert( Qtopia::AddressCategory, QObject::tr( "Categories" ) ); - - ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); - ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); - ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); - ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); - ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); - ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) ); - - ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) ); - ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) ); - ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) ); - ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) ); - ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) ); - ret_map.insert( Qtopia::BusinessMobile, QObject::tr( "Business Mobile" )); - - // email - ret_map.insert( Qtopia::DefaultEmail, QObject::tr( "Default Email" ) ); - ret_map.insert( Qtopia::Emails, QObject::tr( "Emails" ) ); - - ret_map.insert( Qtopia::HomePhone, QObject::tr( "Home Phone" ) ); - ret_map.insert( Qtopia::HomeFax, QObject::tr( "Home Fax" ) ); - ret_map.insert( Qtopia::HomeMobile, QObject::tr( "Home Mobile" ) ); - - // business - ret_map.insert( Qtopia::BusinessStreet, QObject::tr( "Business Street" ) ); - ret_map.insert( Qtopia::BusinessCity, QObject::tr( "Business City" ) ); - ret_map.insert( Qtopia::BusinessState, QObject::tr( "Business State" ) ); - ret_map.insert( Qtopia::BusinessZip, QObject::tr( "Business Zip" ) ); - ret_map.insert( Qtopia::BusinessCountry, QObject::tr( "Business Country" ) ); - ret_map.insert( Qtopia::BusinessPager, QObject::tr( "Business Pager" ) ); - ret_map.insert( Qtopia::BusinessWebPage, QObject::tr( "Business WebPage" ) ); - - ret_map.insert( Qtopia::Office, QObject::tr( "Office" ) ); - ret_map.insert( Qtopia::Profession, QObject::tr( "Profession" ) ); - ret_map.insert( Qtopia::Assistant, QObject::tr( "Assistant" ) ); - ret_map.insert( Qtopia::Manager, QObject::tr( "Manager" ) ); - - // home - ret_map.insert( Qtopia::HomeStreet, QObject::tr( "Home Street" ) ); - ret_map.insert( Qtopia::HomeCity, QObject::tr( "Home City" ) ); - ret_map.insert( Qtopia::HomeState, QObject::tr( "Home State" ) ); - ret_map.insert( Qtopia::HomeZip, QObject::tr( "Home Zip" ) ); - ret_map.insert( Qtopia::HomeCountry, QObject::tr( "Home Country" ) ); - ret_map.insert( Qtopia::HomeWebPage, QObject::tr( "Home Web Page" ) ); - - //personal - ret_map.insert( Qtopia::Spouse, QObject::tr( "Spouse" ) ); - ret_map.insert( Qtopia::Gender, QObject::tr( "Gender" ) ); - ret_map.insert( Qtopia::Birthday, QObject::tr( "Birthday" ) ); - ret_map.insert( Qtopia::Anniversary, QObject::tr( "Anniversary" ) ); - ret_map.insert( Qtopia::Nickname, QObject::tr( "Nickname" ) ); - ret_map.insert( Qtopia::Children, QObject::tr( "Children" ) ); - - // other - ret_map.insert( Qtopia::Notes, QObject::tr( "Notes" ) ); - - - return ret_map; + QMap<int, QString> ret_map; + + ret_map.insert( Qtopia::AddressUid, QObject::tr( "User Id" ) ); + ret_map.insert( Qtopia::AddressCategory, QObject::tr( "Categories" ) ); + + ret_map.insert( Qtopia::Title, QObject::tr( "Name Title" ) ); + ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); + ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); + ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); + ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" ) ); + ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) ); + + ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) ); + ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) ); + ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) ); + ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) ); + ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) ); + ret_map.insert( Qtopia::BusinessMobile, QObject::tr( "Business Mobile" ) ); + + // email + ret_map.insert( Qtopia::DefaultEmail, QObject::tr( "Default Email" ) ); + ret_map.insert( Qtopia::Emails, QObject::tr( "Emails" ) ); + + ret_map.insert( Qtopia::HomePhone, QObject::tr( "Home Phone" ) ); + ret_map.insert( Qtopia::HomeFax, QObject::tr( "Home Fax" ) ); + ret_map.insert( Qtopia::HomeMobile, QObject::tr( "Home Mobile" ) ); + + // business + ret_map.insert( Qtopia::BusinessStreet, QObject::tr( "Business Street" ) ); + ret_map.insert( Qtopia::BusinessCity, QObject::tr( "Business City" ) ); + ret_map.insert( Qtopia::BusinessState, QObject::tr( "Business State" ) ); + ret_map.insert( Qtopia::BusinessZip, QObject::tr( "Business Zip" ) ); + ret_map.insert( Qtopia::BusinessCountry, QObject::tr( "Business Country" ) ); + ret_map.insert( Qtopia::BusinessPager, QObject::tr( "Business Pager" ) ); + ret_map.insert( Qtopia::BusinessWebPage, QObject::tr( "Business WebPage" ) ); + + ret_map.insert( Qtopia::Office, QObject::tr( "Office" ) ); + ret_map.insert( Qtopia::Profession, QObject::tr( "Profession" ) ); + ret_map.insert( Qtopia::Assistant, QObject::tr( "Assistant" ) ); + ret_map.insert( Qtopia::Manager, QObject::tr( "Manager" ) ); + + // home + ret_map.insert( Qtopia::HomeStreet, QObject::tr( "Home Street" ) ); + ret_map.insert( Qtopia::HomeCity, QObject::tr( "Home City" ) ); + ret_map.insert( Qtopia::HomeState, QObject::tr( "Home State" ) ); + ret_map.insert( Qtopia::HomeZip, QObject::tr( "Home Zip" ) ); + ret_map.insert( Qtopia::HomeCountry, QObject::tr( "Home Country" ) ); + ret_map.insert( Qtopia::HomeWebPage, QObject::tr( "Home Web Page" ) ); + + //personal + ret_map.insert( Qtopia::Spouse, QObject::tr( "Spouse" ) ); + ret_map.insert( Qtopia::Gender, QObject::tr( "Gender" ) ); + ret_map.insert( Qtopia::Birthday, QObject::tr( "Birthday" ) ); + ret_map.insert( Qtopia::Anniversary, QObject::tr( "Anniversary" ) ); + ret_map.insert( Qtopia::Nickname, QObject::tr( "Nickname" ) ); + ret_map.insert( Qtopia::Children, QObject::tr( "Children" ) ); + + // other + ret_map.insert( Qtopia::Notes, QObject::tr( "Notes" ) ); + + + return ret_map; } QMap<int, QString> OContactFields::idToUntrFields() { - QMap<int, QString> ret_map; - - ret_map.insert( Qtopia::AddressUid, "User Id" ); - ret_map.insert( Qtopia::AddressCategory, "Categories" ); - - ret_map.insert( Qtopia::Title, "Name Title" ); - ret_map.insert( Qtopia::FirstName, "First Name" ); - ret_map.insert( Qtopia::MiddleName, "Middle Name" ); - ret_map.insert( Qtopia::LastName, "Last Name" ); - ret_map.insert( Qtopia::Suffix, "Suffix" ); - ret_map.insert( Qtopia::FileAs, "File As" ); - - ret_map.insert( Qtopia::JobTitle, "Job Title" ); - ret_map.insert( Qtopia::Department, "Department" ); - ret_map.insert( Qtopia::Company, "Company" ); - ret_map.insert( Qtopia::BusinessPhone, "Business Phone" ); - ret_map.insert( Qtopia::BusinessFax, "Business Fax" ); - ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" ); - - // email - ret_map.insert( Qtopia::DefaultEmail, "Default Email" ); - ret_map.insert( Qtopia::Emails, "Emails" ); - - ret_map.insert( Qtopia::HomePhone, "Home Phone" ); - ret_map.insert( Qtopia::HomeFax, "Home Fax" ); - ret_map.insert( Qtopia::HomeMobile, "Home Mobile" ); - - // business - ret_map.insert( Qtopia::BusinessStreet, "Business Street" ); - ret_map.insert( Qtopia::BusinessCity, "Business City" ); - ret_map.insert( Qtopia::BusinessState, "Business State" ); - ret_map.insert( Qtopia::BusinessZip, "Business Zip" ); - ret_map.insert( Qtopia::BusinessCountry, "Business Country" ); - ret_map.insert( Qtopia::BusinessPager, "Business Pager" ); - ret_map.insert( Qtopia::BusinessWebPage, "Business WebPage" ); - - ret_map.insert( Qtopia::Office, "Office" ); - ret_map.insert( Qtopia::Profession, "Profession" ); - ret_map.insert( Qtopia::Assistant, "Assistant" ); - ret_map.insert( Qtopia::Manager, "Manager" ); - - // home - ret_map.insert( Qtopia::HomeStreet, "Home Street" ); - ret_map.insert( Qtopia::HomeCity, "Home City" ); - ret_map.insert( Qtopia::HomeState, "Home State" ); - ret_map.insert( Qtopia::HomeZip, "Home Zip" ); - ret_map.insert( Qtopia::HomeCountry, "Home Country" ); - ret_map.insert( Qtopia::HomeWebPage, "Home Web Page" ); - - //personal - ret_map.insert( Qtopia::Spouse, "Spouse" ); - ret_map.insert( Qtopia::Gender, "Gender" ); - ret_map.insert( Qtopia::Birthday, "Birthday" ); - ret_map.insert( Qtopia::Anniversary, "Anniversary" ); - ret_map.insert( Qtopia::Nickname, "Nickname" ); - ret_map.insert( Qtopia::Children, "Children" ); - - // other - ret_map.insert( Qtopia::Notes, "Notes" ); - ret_map.insert( Qtopia::Groups, "Groups" ); - - - return ret_map; + QMap<int, QString> ret_map; + + ret_map.insert( Qtopia::AddressUid, "User Id" ); + ret_map.insert( Qtopia::AddressCategory, "Categories" ); + + ret_map.insert( Qtopia::Title, "Name Title" ); + ret_map.insert( Qtopia::FirstName, "First Name" ); + ret_map.insert( Qtopia::MiddleName, "Middle Name" ); + ret_map.insert( Qtopia::LastName, "Last Name" ); + ret_map.insert( Qtopia::Suffix, "Suffix" ); + ret_map.insert( Qtopia::FileAs, "File As" ); + + ret_map.insert( Qtopia::JobTitle, "Job Title" ); + ret_map.insert( Qtopia::Department, "Department" ); + ret_map.insert( Qtopia::Company, "Company" ); + ret_map.insert( Qtopia::BusinessPhone, "Business Phone" ); + ret_map.insert( Qtopia::BusinessFax, "Business Fax" ); + ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" ); + + // email + ret_map.insert( Qtopia::DefaultEmail, "Default Email" ); + ret_map.insert( Qtopia::Emails, "Emails" ); + + ret_map.insert( Qtopia::HomePhone, "Home Phone" ); + ret_map.insert( Qtopia::HomeFax, "Home Fax" ); + ret_map.insert( Qtopia::HomeMobile, "Home Mobile" ); + + // business + ret_map.insert( Qtopia::BusinessStreet, "Business Street" ); + ret_map.insert( Qtopia::BusinessCity, "Business City" ); + ret_map.insert( Qtopia::BusinessState, "Business State" ); + ret_map.insert( Qtopia::BusinessZip, "Business Zip" ); + ret_map.insert( Qtopia::BusinessCountry, "Business Country" ); + ret_map.insert( Qtopia::BusinessPager, "Business Pager" ); + ret_map.insert( Qtopia::BusinessWebPage, "Business WebPage" ); + + ret_map.insert( Qtopia::Office, "Office" ); + ret_map.insert( Qtopia::Profession, "Profession" ); + ret_map.insert( Qtopia::Assistant, "Assistant" ); + ret_map.insert( Qtopia::Manager, "Manager" ); + + // home + ret_map.insert( Qtopia::HomeStreet, "Home Street" ); + ret_map.insert( Qtopia::HomeCity, "Home City" ); + ret_map.insert( Qtopia::HomeState, "Home State" ); + ret_map.insert( Qtopia::HomeZip, "Home Zip" ); + ret_map.insert( Qtopia::HomeCountry, "Home Country" ); + ret_map.insert( Qtopia::HomeWebPage, "Home Web Page" ); + + //personal + ret_map.insert( Qtopia::Spouse, "Spouse" ); + ret_map.insert( Qtopia::Gender, "Gender" ); + ret_map.insert( Qtopia::Birthday, "Birthday" ); + ret_map.insert( Qtopia::Anniversary, "Anniversary" ); + ret_map.insert( Qtopia::Nickname, "Nickname" ); + ret_map.insert( Qtopia::Children, "Children" ); + + // other + ret_map.insert( Qtopia::Notes, "Notes" ); + ret_map.insert( Qtopia::Groups, "Groups" ); + + + return ret_map; } QMap<QString, int> OContactFields::trFieldsToId() { - QMap<int, QString> idtostr = idToTrFields(); - QMap<QString, int> ret_map; + QMap<int, QString> idtostr = idToTrFields(); + QMap<QString, int> ret_map; - QMap<int, QString>::Iterator it; - for( it = idtostr.begin(); it != idtostr.end(); ++it ) - ret_map.insert( *it, it.key() ); + QMap<int, QString>::Iterator it; + for ( it = idtostr.begin(); it != idtostr.end(); ++it ) + ret_map.insert( *it, it.key() ); - return ret_map; + return ret_map; } /* ======================================================================= */ QMap<QString, int> OContactFields::untrFieldsToId() { - QMap<int, QString> idtostr = idToUntrFields(); - QMap<QString, int> ret_map; + QMap<int, QString> idtostr = idToUntrFields(); + QMap<QString, int> ret_map; - QMap<int, QString>::Iterator it; - for( it = idtostr.begin(); it != idtostr.end(); ++it ) - ret_map.insert( *it, it.key() ); + QMap<int, QString>::Iterator it; + for ( it = idtostr.begin(); it != idtostr.end(); ++it ) + ret_map.insert( *it, it.key() ); - return ret_map; + return ret_map; } -OContactFields::OContactFields(): - fieldOrder( DEFAULT_FIELD_ORDER ), - changedFieldOrder( false ) +OContactFields::OContactFields() : + fieldOrder( DEFAULT_FIELD_ORDER ), + changedFieldOrder( false ) { - // Get the global field order from the config file and - // use it as a start pattern - Config cfg ( "AddressBook" ); - cfg.setGroup( "ContactFieldOrder" ); - globalFieldOrder = cfg.readEntry( "General", DEFAULT_FIELD_ORDER ); + // Get the global field order from the config file and + // use it as a start pattern + Config cfg ( "AddressBook" ); + cfg.setGroup( "ContactFieldOrder" ); + globalFieldOrder = cfg.readEntry( "General", DEFAULT_FIELD_ORDER ); } -OContactFields::~OContactFields(){ +OContactFields::~OContactFields() +{ - // We will store the fieldorder into the config file - // to reuse it for the future.. - if ( changedFieldOrder ){ - Config cfg ( "AddressBook" ); - cfg.setGroup( "ContactFieldOrder" ); - cfg.writeEntry( "General", globalFieldOrder ); - } + // We will store the fieldorder into the config file + // to reuse it for the future.. + if ( changedFieldOrder ) + { + Config cfg ( "AddressBook" ); + cfg.setGroup( "ContactFieldOrder" ); + cfg.writeEntry( "General", globalFieldOrder ); + } } -void OContactFields::saveToRecord( OContact &cnt ){ +void OContactFields::saveToRecord( OContact &cnt ) +{ - qDebug("ocontactfields saveToRecord: >%s<",fieldOrder.latin1()); + qDebug( "ocontactfields saveToRecord: >%s<", fieldOrder.latin1() ); - // Store fieldorder into this contact. - cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); + // Store fieldorder into this contact. + cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); - globalFieldOrder = fieldOrder; - changedFieldOrder = true; + globalFieldOrder = fieldOrder; + changedFieldOrder = true; } -void OContactFields::loadFromRecord( const OContact &cnt ){ - qDebug("ocontactfields loadFromRecord"); - qDebug("loading >%s<",cnt.fullName().latin1()); +void OContactFields::loadFromRecord( const OContact &cnt ) +{ + qDebug( "ocontactfields loadFromRecord" ); + qDebug( "loading >%s<", cnt.fullName().latin1() ); - // Get fieldorder for this contact. If none is defined, - // we will use the global one from the config file.. + // Get fieldorder for this contact. If none is defined, + // we will use the global one from the config file.. - fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); + fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); - qDebug("fieldOrder from contact>%s<",fieldOrder.latin1()); + qDebug( "fieldOrder from contact>%s<", fieldOrder.latin1() ); - if (fieldOrder.isEmpty()){ - fieldOrder = globalFieldOrder; - } + if ( fieldOrder.isEmpty() ) + { + fieldOrder = globalFieldOrder; + } - qDebug("effective fieldOrder in loadFromRecord >%s<",fieldOrder.latin1()); + qDebug( "effective fieldOrder in loadFromRecord >%s<", fieldOrder.latin1() ); } -void OContactFields::setFieldOrder( int num, int index ){ - qDebug("qcontactfields setfieldorder pos %i -> %i",num,index); +void OContactFields::setFieldOrder( int num, int index ) +{ + qDebug( "qcontactfields setfieldorder pos %i -> %i", num, index ); - fieldOrder[num] = QString::number( index, 16 )[0]; + fieldOrder[ num ] = QString::number( index, 16 ) [ 0 ]; - // We will store this new fieldorder globally to - // remember it for contacts which have none - globalFieldOrder = fieldOrder; - changedFieldOrder = true; + // We will store this new fieldorder globally to + // remember it for contacts which have none + globalFieldOrder = fieldOrder; + changedFieldOrder = true; - qDebug("fieldOrder >%s<",fieldOrder.latin1()); + qDebug( "fieldOrder >%s<", fieldOrder.latin1() ); } -int OContactFields::getFieldOrder( int num, int defIndex ){ - qDebug("ocontactfields getFieldOrder"); - qDebug("fieldOrder >%s<",fieldOrder.latin1()); +int OContactFields::getFieldOrder( int num, int defIndex ) +{ + qDebug( "ocontactfields getFieldOrder" ); + qDebug( "fieldOrder >%s<", fieldOrder.latin1() ); - // Get index of combo as char.. - QChar poschar = fieldOrder[num]; + // Get index of combo as char.. + QChar poschar = fieldOrder[ num ]; - bool ok; - int ret = 0; - // Convert char to number.. - if ( !( poschar == QChar::null ) ) - ret = QString( poschar ).toInt(&ok, 16); - else - ok = false; + bool ok; + int ret = 0; + // Convert char to number.. + if ( !( poschar == QChar::null ) ) + ret = QString( poschar ).toInt( &ok, 16 ); + else + ok = false; - // Return default value if index for - // num was not set or if anything else happened.. - if ( !ok ) ret = defIndex; + // Return default value if index for + // num was not set or if anything else happened.. + if ( !ok ) ret = defIndex; - qDebug("returning >%i<",ret); + qDebug( "returning >%i<", ret ); - return ret; + return ret; } } |