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) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/ocontactfields.cpp | 40 |
1 files changed, 25 insertions, 15 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,23 +24,26 @@ -- :-=` 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 ) { @@ -420,70 +423,77 @@ OContactFields::OContactFields(): // 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 ){ + 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()); // Store fieldorder into this contact. cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); globalFieldOrder = fieldOrder; changedFieldOrder = true; } -void OContactFields::loadFromRecord( const OContact &cnt ){ +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.. fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); qDebug("fieldOrder from contact>%s<",fieldOrder.latin1()); - if (fieldOrder.isEmpty()){ + if ( fieldOrder.isEmpty() ) + { fieldOrder = globalFieldOrder; } qDebug("effective fieldOrder in loadFromRecord >%s<",fieldOrder.latin1()); } -void OContactFields::setFieldOrder( int num, int index ){ +void OContactFields::setFieldOrder( int num, int index ) +{ qDebug("qcontactfields setfieldorder pos %i -> %i",num,index); 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; qDebug("fieldOrder >%s<",fieldOrder.latin1()); } -int OContactFields::getFieldOrder( int num, int defIndex ){ +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]; |