author | zautrix <zautrix> | 2005-01-17 19:49:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-17 19:49:42 (UTC) |
commit | 522486966ecf041a6e49913b6e420d58d4284837 (patch) (side-by-side diff) | |
tree | d15da3e6ef9ec4638eba4aaf9f14ef0c5eaecd04 /kabc | |
parent | 32479683283fc9f20d369ac9671ba0f8a33d3381 (diff) | |
download | kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.zip kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.gz kdepimpi-522486966ecf041a6e49913b6e420d58d4284837.tar.bz2 |
const fixes
-rw-r--r-- | kabc/addressbook.cpp | 4 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 | ||||
-rw-r--r-- | kabc/addressee.cpp | 10 | ||||
-rw-r--r-- | kabc/addressee.h | 10 |
4 files changed, 13 insertions, 13 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 4de7da2..9e61261 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -951,27 +951,27 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool } bool AddressBook::containsExternalUid( const QString& uid ) { Iterator it; for ( it = begin(); it != end(); ++it ) { if ( uid == (*it).externalUID( ) ) return true; } return false; } -Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) +const Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) const { - Iterator it; + ConstIterator it; for ( it = begin(); it != end(); ++it ) { if ( uid == (*it).getID( profile ) ) return (*it); } return Addressee(); } void AddressBook::mergeAB( AddressBook *aBook, const QString& profile , bool isSubset ) { Iterator it; Addressee ad; for ( it = begin(); it != end(); ++it ) { ad = aBook->findByExternUid( (*it).externalUID(), profile ); diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 2351add..18c03b5 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h @@ -295,25 +295,25 @@ class AddressBook : public QObject /** Query all resources to clean up their lock files */ void cleanUp(); // sync stuff //Addressee::List getExternLastSyncAddressees(); void resetTempSyncStat(); QStringList uidList(); void removeSyncAddressees( bool removeDeleted = false ); void mergeAB( AddressBook *aBook, const QString& profile, bool isSubset ); - Addressee findByExternUid( const QString& uid , const QString& profile ); + const Addressee findByExternUid( const QString& uid , const QString& profile ) const; bool containsExternalUid( const QString& uid ); void preExternSync( AddressBook* aBook, const QString& csd, bool isSubset ); void postExternSync( AddressBook* aBook, const QString& csd , bool setID ); signals: /** Emitted, when the address book has changed on disk. */ void addressBookChanged( AddressBook * ); /** Emitted, when the address book has been locked for writing. diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index d60cd6b..3b238f5 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -580,62 +580,62 @@ void Addressee::setID( const QString & prof , const QString & id ) } void Addressee::setTempSyncStat( int id ) { if ( mData->mTempSyncStat == id ) return; detach(); mData->mTempSyncStat = id; } int Addressee::tempSyncStat() const { return mData->mTempSyncStat; } -QString Addressee::getID( const QString & prof) +const QString Addressee::getID( const QString & prof) const { return KIdManager::getId ( mData->mExternalId, prof ); } void Addressee::setCsum( const QString & prof , const QString & id ) { detach(); //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); } -QString Addressee::getCsum( const QString & prof) +const QString Addressee::getCsum( const QString & prof) const { return KIdManager::getCsum ( mData->mExternalId, prof ); } void Addressee::setIDStr( const QString & s ) { detach(); mData->mExternalId = s; } -QString Addressee::IDStr() const +const QString Addressee::IDStr() const { return mData->mExternalId; } void Addressee::setExternalUID( const QString &id ) { if ( id == mData->externalUID ) return; detach(); mData->empty = false; mData->externalUID = id; } -QString Addressee::externalUID() const +const QString Addressee::externalUID() const { return mData->externalUID; } void Addressee::setOriginalExternalUID( const QString &id ) { if ( id == mData->originalExternalUID ) return; detach(); mData->empty = false; //qDebug("*******Set orig uid %s ", id.latin1()); mData->originalExternalUID = id; } @@ -644,25 +644,25 @@ QString Addressee::originalExternalUID() const return mData->originalExternalUID; } void Addressee::setUid( const QString &id ) { if ( id == mData->uid ) return; detach(); //qDebug("****setuid %s ", id.latin1()); mData->empty = false; mData->uid = id; } -QString Addressee::uid() const +const QString Addressee::uid() const { if ( mData->uid.isEmpty() ) mData->uid = KApplication::randomString( 10 ); return mData->uid; } QString Addressee::uidLabel() { return i18n("Unique Identifier"); } diff --git a/kabc/addressee.h b/kabc/addressee.h index 08d2f56..8051fec 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h @@ -91,56 +91,56 @@ class Addressee Addressee(); ~Addressee(); Addressee( const Addressee & ); Addressee &operator=( const Addressee & ); bool operator==( const Addressee & ) const; bool operator!=( const Addressee & ) const; // sync stuff void setTempSyncStat(int id); int tempSyncStat() const; void setIDStr( const QString & ); - QString IDStr() const; + const QString IDStr() const; void setID( const QString &, const QString & ); - QString getID( const QString & ); + const QString getID( const QString & ) const; void setCsum( const QString &, const QString & ); - QString getCsum( const QString & ); + const QString getCsum( const QString & ) const ; void removeID(const QString &); void computeCsum(const QString &dev); ulong getCsum4List( const QStringList & attList); /** Return, if the address book entry is empty. */ bool isEmpty() const; void setExternalUID( const QString &id ); - QString externalUID() const; + const QString externalUID() const; void setOriginalExternalUID( const QString &id ); QString originalExternalUID() const; void mergeContact( const Addressee& ad, bool isSubSet ); void simplifyEmails(); void simplifyAddresses(); void simplifyPhoneNumbers(); void simplifyPhoneNumberTypes(); bool removeVoice(); bool containsAdr(const Addressee& addr ); /** Set unique identifier. */ void setUid( const QString &uid ); /** Return unique identifier. */ - QString uid() const; + const QString uid() const; /** Return translated label for uid field. */ static QString uidLabel(); /** Set name. */ void setName( const QString &name ); /** Return name. */ |