diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkpimidentities/identity.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkpimidentities/identity.cpp')
-rw-r--r-- | libkpimidentities/identity.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/libkpimidentities/identity.cpp b/libkpimidentities/identity.cpp index 19cd65935..fb2f1ac18 100644 --- a/libkpimidentities/identity.cpp +++ b/libkpimidentities/identity.cpp @@ -236,6 +236,7 @@ const Identity& Identity::null() bool Identity::isNull() const { return mIdentity.isEmpty() && mFullName.isEmpty() && mEmailAddr.isEmpty() && + mEmailAliases.empty() && mOrganization.isEmpty() && mReplyToAddr.isEmpty() && mBcc.isEmpty() && mVCardFile.isEmpty() && mFcc.isEmpty() && mDrafts.isEmpty() && mTemplates.isEmpty() && @@ -251,6 +252,7 @@ bool Identity::operator==( const Identity & other ) const { bool same = mUoid == other.mUoid && mIdentity == other.mIdentity && mFullName == other.mFullName && mEmailAddr == other.mEmailAddr && mOrganization == other.mOrganization && + mEmailAliases == other.mEmailAliases && mReplyToAddr == other.mReplyToAddr && mBcc == other.mBcc && mVCardFile == other.mVCardFile && mFcc == other.mFcc && @@ -271,6 +273,7 @@ bool Identity::operator==( const Identity & other ) const { if ( mIdentity != other.mIdentity ) kdDebug() << "mIdentity differs : " << mIdentity << " != " << other.mIdentity << endl; if ( mFullName != other.mFullName ) kdDebug() << "mFullName differs : " << mFullName << " != " << other.mFullName << endl; if ( mEmailAddr != other.mEmailAddr ) kdDebug() << "mEmailAddr differs : " << mEmailAddr << " != " << other.mEmailAddr << endl; + if ( mEmailAliases != other.mEmailAliases ) kdDebug() << "mEmailAliases differs : " << mEmailAliases.join(";") << " != " << other.mEmailAliases.join(";") << endl; if ( mOrganization != other.mOrganization ) kdDebug() << "mOrganization differs : " << mOrganization << " != " << other.mOrganization << endl; if ( mReplyToAddr != other.mReplyToAddr ) kdDebug() << "mReplyToAddr differs : " << mReplyToAddr << " != " << other.mReplyToAddr << endl; if ( mBcc != other.mBcc ) kdDebug() << "mBcc differs : " << mBcc << " != " << other.mBcc << endl; @@ -320,6 +323,7 @@ void Identity::readConfig( const KConfigBase * config ) mIdentity = config->readEntry("Identity"); mFullName = config->readEntry("Name"); mEmailAddr = config->readEntry("Email Address"); + mEmailAliases = config->readListEntry("Email Aliases"); mVCardFile = config->readPathEntry("VCardFile"); mOrganization = config->readEntry("Organization"); mPGPSigningKey = config->readEntry("PGP Signing Key").latin1(); @@ -362,6 +366,7 @@ void Identity::writeConfig( KConfigBase * config ) const config->writeEntry("SMIME Encryption Key", mSMIMEEncryptionKey.data()); config->writeEntry("Preferred Crypto Message Format", Kleo::cryptoMessageFormatToString( mPreferredCryptoMessageFormat ) ); config->writeEntry("Email Address", mEmailAddr); + config->writeEntry("Email Aliases", mEmailAliases); config->writeEntry("Reply-To Address", mReplyToAddr); config->writeEntry("Bcc", mBcc); config->writePathEntry("VCardFile", mVCardFile); @@ -385,7 +390,8 @@ TQDataStream & KPIM::operator<<( TQDataStream & stream, const KPIM::Identity & i << i.pgpEncryptionKey() << i.smimeSigningKey() << i.smimeEncryptionKey() - << i.emailAddr() + << i.primaryEmailAddress() + << i.emailAliases() << i.replyToAddr() << i.bcc() << i.vCardFile() @@ -411,6 +417,7 @@ TQDataStream & KPIM::operator>>( TQDataStream & stream, KPIM::Identity & i ) { >> i.mSMIMESigningKey >> i.mSMIMEEncryptionKey >> i.mEmailAddr + >> i.mEmailAliases >> i.mReplyToAddr >> i.mBcc >> i.mVCardFile @@ -484,11 +491,26 @@ void Identity::setSMIMEEncryptionKey(const TQCString &str) } //----------------------------------------------------------------------------- -void Identity::setEmailAddr(const TQString &str) +void Identity::setPrimaryEmailAddress( const TQString & str ) { mEmailAddr = str; } +void Identity::setEmailAliases( const TQStringList & list ) +{ + mEmailAliases = list; +} + +bool Identity::matchesEmailAddress( const TQString & addr ) const +{ + const TQString lower = addr.lower(); + if ( lower == mEmailAddr.lower() ) + return true; + for ( TQStringList::const_iterator it = mEmailAliases.begin(), end = mEmailAliases.end() ; it != end ; ++it ) + if ( (*it).lower() == lower ) + return true; + return false; +} //----------------------------------------------------------------------------- void Identity::setVCardFile(const TQString &str) |