diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:34:45 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-03 04:24:29 +0200 |
commit | e3649f744289c180537d2d8474dc0e39050e654f (patch) | |
tree | 5d3d773985c0bfdfed5e0aed35fe8b2441d60787 /kmail/kmmsgbase.cpp | |
parent | 4b4a3f32d8e71d79626206211ee6e23ee1e968b8 (diff) | |
download | tdepim-e3649f744289c180537d2d8474dc0e39050e654f.tar.gz tdepim-e3649f744289c180537d2d8474dc0e39050e654f.zip |
Rename old tq methods that no longer need a unique name
(cherry picked from commit 0e00c0a86a4c9d7e80c7b66d91940cc7dcb79f78)
Diffstat (limited to 'kmail/kmmsgbase.cpp')
-rw-r--r-- | kmail/kmmsgbase.cpp | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/kmail/kmmsgbase.cpp b/kmail/kmmsgbase.cpp index f1341d6c8..db57a1bf1 100644 --- a/kmail/kmmsgbase.cpp +++ b/kmail/kmmsgbase.cpp @@ -72,7 +72,7 @@ using KMail::MessageProperty; //----------------------------------------------------------------------------- KMMsgBase::KMMsgBase(KMFolder* aParentFolder) : mParent( aParentFolder ), mIndexOffset( 0 ), - mIndexLength( 0 ), mDirty( false ), mEnableUndo( false ), mtqStatus( KMMsgStatusUnknown ) + mIndexLength( 0 ), mDirty( false ), mEnableUndo( false ), mStatus( KMMsgStatusUnknown ) { } @@ -121,145 +121,145 @@ bool KMMsgBase::isMessage(void) const return false; } //----------------------------------------------------------------------------- -void KMMsgBase::toggletqStatus(const KMMsgtqStatus atqStatus, int idx) +void KMMsgBase::toggleStatus(const KMMsgStatus aStatus, int idx) { mDirty = true; - KMMsgtqStatus oldtqStatus = status(); - if ( status() & atqStatus ) { - mtqStatus &= ~atqStatus; + KMMsgStatus oldStatus = status(); + if ( status() & aStatus ) { + mStatus &= ~aStatus; } else { - mtqStatus |= atqStatus; + mStatus |= aStatus; // Ignored and Watched are toggleable, yet mutually exclusive. // That is an arbitrary restriction on my part. HAR HAR HAR :) -till - if (atqStatus == KMMsgStatusWatched) - mtqStatus &= ~KMMsgStatusIgnored; - if (atqStatus == KMMsgStatusIgnored) - mtqStatus &= ~KMMsgStatusWatched; - if (atqStatus == KMMsgStatusSpam) - mtqStatus &= ~KMMsgStatusHam; - if (atqStatus == KMMsgStatusHam) - mtqStatus &= ~KMMsgStatusSpam; + if (aStatus == KMMsgStatusWatched) + mStatus &= ~KMMsgStatusIgnored; + if (aStatus == KMMsgStatusIgnored) + mStatus &= ~KMMsgStatusWatched; + if (aStatus == KMMsgStatusSpam) + mStatus &= ~KMMsgStatusHam; + if (aStatus == KMMsgStatusHam) + mStatus &= ~KMMsgStatusSpam; } if (storage()) { if (idx < 0) idx = storage()->find( this ); - storage()->msgStatusChanged( oldtqStatus, status(), idx ); + storage()->msgStatusChanged( oldStatus, status(), idx ); storage()->headerOfMsgChanged(this, idx); } } //----------------------------------------------------------------------------- -void KMMsgBase::setqStatus(const KMMsgtqStatus atqStatus, int idx) +void KMMsgBase::seStatus(const KMMsgStatus aStatus, int idx) { mDirty = true; - KMMsgtqStatus oldtqStatus = status(); - switch (atqStatus) { + KMMsgStatus oldStatus = status(); + switch (aStatus) { case KMMsgStatusRead: // Unset unread and new, set read - mtqStatus &= ~KMMsgStatusUnread; - mtqStatus &= ~KMMsgStatusNew; - mtqStatus |= KMMsgStatusRead; + mStatus &= ~KMMsgStatusUnread; + mStatus &= ~KMMsgStatusNew; + mStatus |= KMMsgStatusRead; break; case KMMsgStatusUnread: // unread overrides read - mtqStatus &= ~KMMsgStatusOld; - mtqStatus &= ~KMMsgStatusRead; - mtqStatus &= ~KMMsgStatusNew; - mtqStatus |= KMMsgStatusUnread; + mStatus &= ~KMMsgStatusOld; + mStatus &= ~KMMsgStatusRead; + mStatus &= ~KMMsgStatusNew; + mStatus |= KMMsgStatusUnread; break; case KMMsgStatusOld: // old can't be new or unread - mtqStatus &= ~KMMsgStatusNew; - mtqStatus &= ~KMMsgStatusUnread; - mtqStatus |= KMMsgStatusOld; + mStatus &= ~KMMsgStatusNew; + mStatus &= ~KMMsgStatusUnread; + mStatus |= KMMsgStatusOld; break; case KMMsgStatusNew: // new overrides old and read - mtqStatus &= ~KMMsgStatusOld; - mtqStatus &= ~KMMsgStatusRead; - mtqStatus &= ~KMMsgStatusUnread; - mtqStatus |= KMMsgStatusNew; + mStatus &= ~KMMsgStatusOld; + mStatus &= ~KMMsgStatusRead; + mStatus &= ~KMMsgStatusUnread; + mStatus |= KMMsgStatusNew; break; case KMMsgStatusDeleted: - mtqStatus |= KMMsgStatusDeleted; + mStatus |= KMMsgStatusDeleted; break; case KMMsgStatusReplied: - mtqStatus |= KMMsgStatusReplied; + mStatus |= KMMsgStatusReplied; break; case KMMsgStatusForwarded: - mtqStatus |= KMMsgStatusForwarded; + mStatus |= KMMsgStatusForwarded; break; case KMMsgStatusQueued: - mtqStatus |= KMMsgStatusQueued; + mStatus |= KMMsgStatusQueued; break; case KMMsgStatusTodo: - mtqStatus |= KMMsgStatusTodo; + mStatus |= KMMsgStatusTodo; break; case KMMsgStatusSent: - mtqStatus &= ~KMMsgStatusQueued; - mtqStatus &= ~KMMsgStatusUnread; - mtqStatus &= ~KMMsgStatusNew; - mtqStatus |= KMMsgStatusSent; + mStatus &= ~KMMsgStatusQueued; + mStatus &= ~KMMsgStatusUnread; + mStatus &= ~KMMsgStatusNew; + mStatus |= KMMsgStatusSent; break; case KMMsgStatusFlag: - mtqStatus |= KMMsgStatusFlag; + mStatus |= KMMsgStatusFlag; break; // Watched and ignored are mutually exclusive case KMMsgStatusWatched: - mtqStatus &= ~KMMsgStatusIgnored; - mtqStatus |= KMMsgStatusWatched; + mStatus &= ~KMMsgStatusIgnored; + mStatus |= KMMsgStatusWatched; break; case KMMsgStatusIgnored: - mtqStatus &= ~KMMsgStatusWatched; - mtqStatus |= KMMsgStatusIgnored; + mStatus &= ~KMMsgStatusWatched; + mStatus |= KMMsgStatusIgnored; break; // as are ham and spam case KMMsgStatusSpam: - mtqStatus &= ~KMMsgStatusHam; - mtqStatus |= KMMsgStatusSpam; + mStatus &= ~KMMsgStatusHam; + mStatus |= KMMsgStatusSpam; break; case KMMsgStatusHam: - mtqStatus &= ~KMMsgStatusSpam; - mtqStatus |= KMMsgStatusHam; + mStatus &= ~KMMsgStatusSpam; + mStatus |= KMMsgStatusHam; break; case KMMsgStatusHasAttach: - mtqStatus &= ~KMMsgStatusHasNoAttach; - mtqStatus |= KMMsgStatusHasAttach; + mStatus &= ~KMMsgStatusHasNoAttach; + mStatus |= KMMsgStatusHasAttach; break; case KMMsgStatusHasNoAttach: - mtqStatus &= ~KMMsgStatusHasAttach; - mtqStatus |= KMMsgStatusHasNoAttach; + mStatus &= ~KMMsgStatusHasAttach; + mStatus |= KMMsgStatusHasNoAttach; break; case KMMsgStatusHasInvitation: - mtqStatus &= ~KMMsgStatusHasNoInvitation; - mtqStatus |= KMMsgStatusHasInvitation; + mStatus &= ~KMMsgStatusHasNoInvitation; + mStatus |= KMMsgStatusHasInvitation; break; case KMMsgStatusHasNoInvitation: - mtqStatus &= ~KMMsgStatusHasInvitation; - mtqStatus |= KMMsgStatusHasNoInvitation; + mStatus &= ~KMMsgStatusHasInvitation; + mStatus |= KMMsgStatusHasNoInvitation; break; default: - mtqStatus = atqStatus; + mStatus = aStatus; break; } - if ( oldtqStatus != mtqStatus && storage() ) { + if ( oldStatus != mStatus && storage() ) { if (idx < 0) idx = storage()->find( this ); - storage()->msgStatusChanged( oldtqStatus, status(), idx ); + storage()->msgStatusChanged( oldStatus, status(), idx ); storage()->headerOfMsgChanged( this, idx ); } } @@ -267,40 +267,40 @@ void KMMsgBase::setqStatus(const KMMsgtqStatus atqStatus, int idx) //----------------------------------------------------------------------------- -void KMMsgBase::setqStatus(const char* aStatusStr, const char* aXStatusStr) +void KMMsgBase::seStatus(const char* aStatusStr, const char* aXStatusStr) { // first try to find status from "X-Status" field if given if (aXStatusStr) { - if (strchr(aXStatusStr, 'N')) setqStatus(KMMsgStatusNew); - if (strchr(aXStatusStr, 'U')) setqStatus(KMMsgStatusUnread); - if (strchr(aXStatusStr, 'O')) setqStatus(KMMsgStatusOld); - if (strchr(aXStatusStr, 'R')) setqStatus(KMMsgStatusRead); - if (strchr(aXStatusStr, 'D')) setqStatus(KMMsgStatusDeleted); - if (strchr(aXStatusStr, 'A')) setqStatus(KMMsgStatusReplied); - if (strchr(aXStatusStr, 'F')) setqStatus(KMMsgStatusForwarded); - if (strchr(aXStatusStr, 'Q')) setqStatus(KMMsgStatusQueued); - if (strchr(aXStatusStr, 'K')) setqStatus(KMMsgStatusTodo); - if (strchr(aXStatusStr, 'S')) setqStatus(KMMsgStatusSent); - if (strchr(aXStatusStr, 'G')) setqStatus(KMMsgStatusFlag); - if (strchr(aXStatusStr, 'P')) setqStatus(KMMsgStatusSpam); - if (strchr(aXStatusStr, 'H')) setqStatus(KMMsgStatusHam); - if (strchr(aXStatusStr, 'T')) setqStatus(KMMsgStatusHasAttach); - if (strchr(aXStatusStr, 'C')) setqStatus(KMMsgStatusHasNoAttach); + if (strchr(aXStatusStr, 'N')) seStatus(KMMsgStatusNew); + if (strchr(aXStatusStr, 'U')) seStatus(KMMsgStatusUnread); + if (strchr(aXStatusStr, 'O')) seStatus(KMMsgStatusOld); + if (strchr(aXStatusStr, 'R')) seStatus(KMMsgStatusRead); + if (strchr(aXStatusStr, 'D')) seStatus(KMMsgStatusDeleted); + if (strchr(aXStatusStr, 'A')) seStatus(KMMsgStatusReplied); + if (strchr(aXStatusStr, 'F')) seStatus(KMMsgStatusForwarded); + if (strchr(aXStatusStr, 'Q')) seStatus(KMMsgStatusQueued); + if (strchr(aXStatusStr, 'K')) seStatus(KMMsgStatusTodo); + if (strchr(aXStatusStr, 'S')) seStatus(KMMsgStatusSent); + if (strchr(aXStatusStr, 'G')) seStatus(KMMsgStatusFlag); + if (strchr(aXStatusStr, 'P')) seStatus(KMMsgStatusSpam); + if (strchr(aXStatusStr, 'H')) seStatus(KMMsgStatusHam); + if (strchr(aXStatusStr, 'T')) seStatus(KMMsgStatusHasAttach); + if (strchr(aXStatusStr, 'C')) seStatus(KMMsgStatusHasNoAttach); } // Merge the contents of the "Status" field if (aStatusStr) { if ((aStatusStr[0]== 'R' && aStatusStr[1]== 'O') || (aStatusStr[0]== 'O' && aStatusStr[1]== 'R')) { - setqStatus( KMMsgStatusOld ); - setqStatus( KMMsgStatusRead ); + seStatus( KMMsgStatusOld ); + seStatus( KMMsgStatusRead ); } else if (aStatusStr[0] == 'R') - setqStatus(KMMsgStatusRead); + seStatus(KMMsgStatusRead); else if (aStatusStr[0] == 'D') - setqStatus(KMMsgStatusDeleted); + seStatus(KMMsgStatusDeleted); else - setqStatus(KMMsgStatusNew); + seStatus(KMMsgStatusNew); } } @@ -363,117 +363,117 @@ void KMMsgBase::setSignatureStateChar( TQChar status, int idx ) //----------------------------------------------------------------------------- bool KMMsgBase::isUnread(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusUnread && !(st & KMMsgStatusIgnored)); } //----------------------------------------------------------------------------- bool KMMsgBase::isNew(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusNew && !(st & KMMsgStatusIgnored)); } //----------------------------------------------------------------------------- -bool KMMsgBase::isOfUnknowntqStatus(void) const +bool KMMsgBase::isOfUnknownStatus(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st == KMMsgStatusUnknown); } //----------------------------------------------------------------------------- bool KMMsgBase::isOld(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusOld); } //----------------------------------------------------------------------------- bool KMMsgBase::isRead(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusRead || st & KMMsgStatusIgnored); } //----------------------------------------------------------------------------- bool KMMsgBase::isDeleted(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusDeleted); } //----------------------------------------------------------------------------- bool KMMsgBase::isReplied(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusReplied); } //----------------------------------------------------------------------------- bool KMMsgBase::isForwarded(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusForwarded); } //----------------------------------------------------------------------------- bool KMMsgBase::isQueued(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusQueued); } //----------------------------------------------------------------------------- bool KMMsgBase::isTodo(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusTodo); } //----------------------------------------------------------------------------- bool KMMsgBase::isSent(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusSent); } //----------------------------------------------------------------------------- bool KMMsgBase::isImportant(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusFlag); } //----------------------------------------------------------------------------- bool KMMsgBase::isWatched(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusWatched); } //----------------------------------------------------------------------------- bool KMMsgBase::isIgnored(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusIgnored); } //----------------------------------------------------------------------------- bool KMMsgBase::isSpam(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusSpam); } //----------------------------------------------------------------------------- bool KMMsgBase::isHam(void) const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); return (st & KMMsgStatusHam); } //----------------------------------------------------------------------------- -TQCString KMMsgBase::statusToStr(const KMMsgtqStatus status) +TQCString KMMsgBase::statusToStr(const KMMsgStatus status) { TQCString sstr; if (status & KMMsgStatusNew) sstr += 'N'; @@ -1037,7 +1037,7 @@ TQCString KMMsgBase::autoDetectCharset(const TQCString &_encoding, const TQStrin TQStringList charsets = encodingList; if (!_encoding.isEmpty()) { - TQString currentCharset = TQString::tqfromLatin1(_encoding); + TQString currentCharset = TQString::fromLatin1(_encoding); charsets.remove(currentCharset); charsets.prepend(currentCharset); } @@ -1093,7 +1093,7 @@ unsigned long KMMsgBase::getMsgSerNum() const //----------------------------------------------------------------------------- KMMsgAttachmentState KMMsgBase::attachmentState() const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); if (st & KMMsgStatusHasAttach) return KMMsgHasAttachment; else if (st & KMMsgStatusHasNoAttach) @@ -1105,7 +1105,7 @@ KMMsgAttachmentState KMMsgBase::attachmentState() const KMMsgInvitationState KMMsgBase::invitationState() const { - KMMsgtqStatus st = status(); + KMMsgStatus st = status(); if (st & KMMsgStatusHasInvitation) return KMMsgHasInvitation; else if (st & KMMsgStatusHasNoInvitation) @@ -1372,7 +1372,7 @@ const uchar *KMMsgBase::asIndexString(int &length) const //these is at the beginning because it is queried quite often tmp_str = msgIdMD5().stripWhiteSpace(); STORE_DATA_LEN(MsgIdMD5Part, tmp_str.tqunicode(), tmp_str.length() * 2, true); - tmp = mLegacytqStatus; + tmp = mLegacyStatus; STORE_DATA(MsgLegacyStatusPart, tmp); //these are completely arbitrary order @@ -1476,7 +1476,7 @@ TQString KMMsgBase::replacePrefixes( const TQString& str, // construct a big regexp that // 1. is anchored to the beginning of str (sans whitespace) // 2. matches at least one of the part regexps in prefixRegExps - TQString bigRegExp = TQString::tqfromLatin1("^(?:\\s+|(?:%1))+\\s*") + TQString bigRegExp = TQString::fromLatin1("^(?:\\s+|(?:%1))+\\s*") .tqarg( prefixRegExps.join(")|(?:") ); TQRegExp rx( bigRegExp, false /*case insens.*/ ); if ( !rx.isValid() ) { |