diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkpimidentities | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkpimidentities')
-rw-r--r-- | libkpimidentities/identity.cpp | 120 | ||||
-rw-r--r-- | libkpimidentities/identity.h | 160 | ||||
-rw-r--r-- | libkpimidentities/identitycombo.cpp | 16 | ||||
-rw-r--r-- | libkpimidentities/identitycombo.h | 16 | ||||
-rw-r--r-- | libkpimidentities/identitymanager.cpp | 102 | ||||
-rw-r--r-- | libkpimidentities/identitymanager.h | 46 |
6 files changed, 230 insertions, 230 deletions
diff --git a/libkpimidentities/identity.cpp b/libkpimidentities/identity.cpp index 204e997e7..19cd65935 100644 --- a/libkpimidentities/identity.cpp +++ b/libkpimidentities/identity.cpp @@ -17,7 +17,7 @@ #include <kconfig.h> #include <kurl.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <sys/types.h> #include <stdlib.h> @@ -34,14 +34,14 @@ Signature::Signature() } -Signature::Signature( const QString & text ) +Signature::Signature( const TQString & text ) : mText( text ), mType( Inlined ) { } -Signature::Signature( const QString & url, bool isExecutable ) +Signature::Signature( const TQString & url, bool isExecutable ) : mUrl( url ), mType( isExecutable ? FromCommand : FromFile ) { @@ -58,12 +58,12 @@ bool Signature::operator==( const Signature & other ) const { } } -QString Signature::rawText( bool * ok ) const +TQString Signature::rawText( bool * ok ) const { switch ( mType ) { case Disabled: if ( ok ) *ok = true; - return QString::null; + return TQString::null; case Inlined: if ( ok ) *ok = true; return mText; @@ -73,17 +73,17 @@ QString Signature::rawText( bool * ok ) const return textFromCommand( ok ); }; kdFatal( 5006 ) << "Signature::type() returned unknown value!" << endl; - return QString::null; // make compiler happy + return TQString::null; // make compiler happy } -QString Signature::textFromCommand( bool * ok ) const +TQString Signature::textFromCommand( bool * ok ) const { assert( mType == FromCommand ); // handle pathological cases: if ( mUrl.isEmpty() ) { if ( ok ) *ok = true; - return QString::null; + return TQString::null; } // create a shell process: @@ -101,62 +101,62 @@ QString Signature::textFromCommand( bool * ok ) const // handle errors, if any: if ( rc != 0 ) { if ( ok ) *ok = false; - QString wmsg = i18n("<qt>Failed to execute signature script<br><b>%1</b>:<br>%2</qt>") + TQString wmsg = i18n("<qt>Failed to execute signature script<br><b>%1</b>:<br>%2</qt>") .arg( mUrl ).arg( strerror(rc) ); KMessageBox::error(0, wmsg); - return QString::null; + return TQString::null; } // no errors: if ( ok ) *ok = true; // get output: - QByteArray output = proc.collectedStdout(); + TQByteArray output = proc.collectedStdout(); // ### hmm, should we allow other encodings, too? - return QString::fromLocal8Bit( output.data(), output.size() ); + return TQString::fromLocal8Bit( output.data(), output.size() ); } -QString Signature::textFromFile( bool * ok ) const +TQString Signature::textFromFile( bool * ok ) const { assert( mType == FromFile ); // ### FIXME: Use KIO::NetAccess to download non-local files! - if ( !KURL(mUrl).isLocalFile() && !(QFileInfo(mUrl).isRelative() - && QFileInfo(mUrl).exists()) ) { + if ( !KURL(mUrl).isLocalFile() && !(TQFileInfo(mUrl).isRelative() + && TQFileInfo(mUrl).exists()) ) { kdDebug( 5006 ) << "Signature::textFromFile: non-local URLs are unsupported" << endl; if ( ok ) *ok = false; - return QString::null; + return TQString::null; } if ( ok ) *ok = true; // ### hmm, should we allow other encodings, too? - return QString::fromLocal8Bit( kFileToString( mUrl, false ) ); + return TQString::fromLocal8Bit( kFileToString( mUrl, false ) ); } -QString Signature::withSeparator( bool * ok ) const +TQString Signature::withSeparator( bool * ok ) const { bool internalOK = false; - QString signature = rawText( &internalOK ); + TQString signature = rawText( &internalOK ); if ( !internalOK ) { if ( ok ) *ok = false; - return QString::null; + return TQString::null; } if ( ok ) *ok = true; if ( signature.isEmpty() ) return signature; // don't add a separator in this case - if ( signature.startsWith( QString::fromLatin1("-- \n") ) ) + if ( signature.startsWith( TQString::fromLatin1("-- \n") ) ) // already have signature separator at start of sig: - return QString::fromLatin1("\n") += signature; - else if ( signature.find( QString::fromLatin1("\n-- \n") ) != -1 ) + return TQString::fromLatin1("\n") += signature; + else if ( signature.find( TQString::fromLatin1("\n-- \n") ) != -1 ) // already have signature separator inside sig; don't prepend '\n' // to improve abusing signatures as templates: return signature; else // need to prepend one: - return QString::fromLatin1("\n-- \n") + signature; + return TQString::fromLatin1("\n-- \n") + signature; } -void Signature::setUrl( const QString & url, bool isExecutable ) +void Signature::setUrl( const TQString & url, bool isExecutable ) { mUrl = url; mType = isExecutable ? FromCommand : FromFile ; @@ -174,7 +174,7 @@ static const char sigCommandKey[] = "Signature Command"; void Signature::readConfig( const KConfigBase * config ) { - QString sigType = config->readEntry( sigTypeKey ); + TQString sigType = config->readEntry( sigTypeKey ); if ( sigType == sigTypeInlineValue ) { mType = Inlined; } else if ( sigType == sigTypeFileValue ) { @@ -210,13 +210,13 @@ void Signature::writeConfig( KConfigBase * config ) const config->writeEntry( sigTextKey, mText ); } -QDataStream & KPIM::operator<<( QDataStream & stream, const KPIM::Signature & sig ) { +TQDataStream & KPIM::operator<<( TQDataStream & stream, const KPIM::Signature & sig ) { return stream << static_cast<Q_UINT8>(sig.mType) << sig.mUrl << sig.mText; } -QDataStream & KPIM::operator>>( QDataStream & stream, KPIM::Signature & sig ) { +TQDataStream & KPIM::operator>>( TQDataStream & stream, KPIM::Signature & sig ) { Q_UINT8 s; stream >> s >> sig.mUrl @@ -290,9 +290,9 @@ bool Identity::operator==( const Identity & other ) const { return same; } -Identity::Identity( const QString & id, const QString & fullName, - const QString & emailAddr, const QString & organization, - const QString & replyToAddr ) +Identity::Identity( const TQString & id, const TQString & fullName, + const TQString & emailAddr, const TQString & organization, + const TQString & replyToAddr ) : mUoid( 0 ), mIdentity( id ), mFullName( fullName ), mEmailAddr( emailAddr ), mOrganization( organization ), mReplyToAddr( replyToAddr ), @@ -376,7 +376,7 @@ void Identity::writeConfig( KConfigBase * config ) const mSignature.writeConfig( config ); } -QDataStream & KPIM::operator<<( QDataStream & stream, const KPIM::Identity & i ) { +TQDataStream & KPIM::operator<<( TQDataStream & stream, const KPIM::Identity & i ) { return stream << static_cast<Q_UINT32>(i.uoid()) << i.identityName() << i.fullName() @@ -396,12 +396,12 @@ QDataStream & KPIM::operator<<( QDataStream & stream, const KPIM::Identity & i ) << i.mSignature << i.dictionary() << i.xface() - << QString( Kleo::cryptoMessageFormatToString( i.mPreferredCryptoMessageFormat ) ); + << TQString( Kleo::cryptoMessageFormatToString( i.mPreferredCryptoMessageFormat ) ); } -QDataStream & KPIM::operator>>( QDataStream & stream, KPIM::Identity & i ) { +TQDataStream & KPIM::operator>>( TQDataStream & stream, KPIM::Identity & i ) { Q_UINT32 uoid; - QString format; + TQString format; stream >> uoid >> i.mIdentity >> i.mFullName @@ -439,44 +439,44 @@ void Identity::setIsDefault( bool flag ) { mIsDefault = flag; } -void Identity::setIdentityName( const QString & name ) { +void Identity::setIdentityName( const TQString & name ) { mIdentity = name; } -void Identity::setFullName(const QString &str) +void Identity::setFullName(const TQString &str) { mFullName = str; } //----------------------------------------------------------------------------- -void Identity::setOrganization(const QString &str) +void Identity::setOrganization(const TQString &str) { mOrganization = str; } -void Identity::setPGPSigningKey(const QCString &str) +void Identity::setPGPSigningKey(const TQCString &str) { mPGPSigningKey = str; if ( mPGPSigningKey.isNull() ) mPGPSigningKey = ""; } -void Identity::setPGPEncryptionKey(const QCString &str) +void Identity::setPGPEncryptionKey(const TQCString &str) { mPGPEncryptionKey = str; if ( mPGPEncryptionKey.isNull() ) mPGPEncryptionKey = ""; } -void Identity::setSMIMESigningKey(const QCString &str) +void Identity::setSMIMESigningKey(const TQCString &str) { mSMIMESigningKey = str; if ( mSMIMESigningKey.isNull() ) mSMIMESigningKey = ""; } -void Identity::setSMIMEEncryptionKey(const QCString &str) +void Identity::setSMIMEEncryptionKey(const TQCString &str) { mSMIMEEncryptionKey = str; if ( mSMIMEEncryptionKey.isNull() ) @@ -484,27 +484,27 @@ void Identity::setSMIMEEncryptionKey(const QCString &str) } //----------------------------------------------------------------------------- -void Identity::setEmailAddr(const QString &str) +void Identity::setEmailAddr(const TQString &str) { mEmailAddr = str; } //----------------------------------------------------------------------------- -void Identity::setVCardFile(const QString &str) +void Identity::setVCardFile(const TQString &str) { mVCardFile = str; } //----------------------------------------------------------------------------- -QString Identity::fullEmailAddr(void) const +TQString Identity::fullEmailAddr(void) const { if (mFullName.isEmpty()) return mEmailAddr; - const QString specials("()<>@,.;:[]"); + const TQString specials("()<>@,.;:[]"); - QString result; + TQString result; // add DQUOTE's if necessary: bool needsQuotes=false; @@ -529,28 +529,28 @@ QString Identity::fullEmailAddr(void) const } //----------------------------------------------------------------------------- -void Identity::setReplyToAddr(const QString& str) +void Identity::setReplyToAddr(const TQString& str) { mReplyToAddr = str; } //----------------------------------------------------------------------------- -void Identity::setSignatureFile(const QString &str) +void Identity::setSignatureFile(const TQString &str) { mSignature.setUrl( str, signatureIsCommand() ); } //----------------------------------------------------------------------------- -void Identity::setSignatureInlineText(const QString &str ) +void Identity::setSignatureInlineText(const TQString &str ) { mSignature.setText( str ); } //----------------------------------------------------------------------------- -void Identity::setTransport( const QString &str ) +void Identity::setTransport( const TQString &str ) { mTransport = str; if ( mTransport.isNull() ) @@ -558,7 +558,7 @@ void Identity::setTransport( const QString &str ) } //----------------------------------------------------------------------------- -void Identity::setFcc( const QString &str ) +void Identity::setFcc( const TQString &str ) { mFcc = str; if ( mFcc.isNull() ) @@ -566,7 +566,7 @@ void Identity::setFcc( const QString &str ) } //----------------------------------------------------------------------------- -void Identity::setDrafts( const QString &str ) +void Identity::setDrafts( const TQString &str ) { mDrafts = str; if ( mDrafts.isNull() ) @@ -574,7 +574,7 @@ void Identity::setDrafts( const QString &str ) } //----------------------------------------------------------------------------- -void Identity::setTemplates( const QString &str ) +void Identity::setTemplates( const TQString &str ) { mTemplates = str; if ( mTemplates.isNull() ) @@ -582,7 +582,7 @@ void Identity::setTemplates( const QString &str ) } //----------------------------------------------------------------------------- -void Identity::setDictionary( const QString &str ) +void Identity::setDictionary( const TQString &str ) { mDictionary = str; if ( mDictionary.isNull() ) @@ -591,7 +591,7 @@ void Identity::setDictionary( const QString &str ) //----------------------------------------------------------------------------- -void Identity::setXFace( const QString &str ) +void Identity::setXFace( const TQString &str ) { mXFace = str; mXFace.remove( " " ); @@ -608,10 +608,10 @@ void Identity::setXFaceEnabled( const bool on ) //----------------------------------------------------------------------------- -QString Identity::signatureText( bool * ok ) const +TQString Identity::signatureText( bool * ok ) const { bool internalOK = false; - QString signatureText = mSignature.withSeparator( &internalOK ); + TQString signatureText = mSignature.withSeparator( &internalOK ); if ( internalOK ) { if ( ok ) *ok=true; return signatureText; @@ -621,7 +621,7 @@ QString Identity::signatureText( bool * ok ) const // Signature::withSeparator() failed, so we should probably fix the // cause: if ( ok ) *ok = false; - return QString::null; + return TQString::null; #if 0 // ### FIXME: error handling if (mSignatureFile.endsWith("|")) @@ -632,5 +632,5 @@ QString Identity::signatureText( bool * ok ) const } #endif - return QString::null; + return TQString::null; } diff --git a/libkpimidentities/identity.h b/libkpimidentities/identity.h index 6b06e9a9d..0493a3864 100644 --- a/libkpimidentities/identity.h +++ b/libkpimidentities/identity.h @@ -11,9 +11,9 @@ #include <kdepimmacros.h> -#include <qstring.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqstringlist.h> class KProcess; namespace KPIM { @@ -33,8 +33,8 @@ namespace KPIM { class KDE_EXPORT Signature { friend class Identity; - friend QDataStream & KPIM::operator<<( QDataStream & stream, const Signature & sig ); - friend QDataStream & KPIM::operator>>( QDataStream & stream, Signature & sig ); + friend TQDataStream & KPIM::operator<<( TQDataStream & stream, const Signature & sig ); + friend TQDataStream & KPIM::operator>>( TQDataStream & stream, Signature & sig ); public: /** Type of signature (ie. way to obtain the signature text) */ @@ -46,26 +46,26 @@ public: /** Constructor for disabled signature */ Signature(); /** Constructor for inline text */ - Signature( const QString & text ); + Signature( const TQString & text ); /** Constructor for text from a file or from output of a command */ - Signature( const QString & url, bool isExecutable ); + Signature( const TQString & url, bool isExecutable ); /** @return the raw signature text as entered resp. read from file. */ - QString rawText( bool * ok=0 ) const; + TQString rawText( bool * ok=0 ) const; /** @return the signature text with a "-- " separator added, if necessary. */ - QString withSeparator( bool * ok=0 ) const; + TQString withSeparator( bool * ok=0 ) const; /** Set the signature text and mark this signature as being of "inline text" type. */ - void setText( const QString & text ) { mText = text; } - QString text() const { return mText; } + void setText( const TQString & text ) { mText = text; } + TQString text() const { return mText; } /** Set the signature URL and mark this signature as being of "from file" resp. "from output of command" type. */ - void setUrl( const QString & url, bool isExecutable=false ); - QString url() const { return mUrl; } + void setUrl( const TQString & url, bool isExecutable=false ); + TQString url() const { return mUrl; } /// @return the type of signature (ie. way to obtain the signature text) Type type() const { return mType; } @@ -76,12 +76,12 @@ protected: void readConfig( const KConfigBase * config ); private: - QString textFromFile( bool * ok ) const; - QString textFromCommand( bool * ok ) const; + TQString textFromFile( bool * ok ) const; + TQString textFromCommand( bool * ok ) const; private: - QString mUrl; - QString mText; + TQString mUrl; + TQString mText; Type mType; }; @@ -90,14 +90,14 @@ class KDE_EXPORT Identity { // only the identity manager should be able to construct and // destruct us, but then we get into problems with using - // QValueList<Identity> and especially qHeapSort(). + // TQValueList<Identity> and especially qHeapSort(). friend class IdentityManager; - friend QDataStream & operator<<( QDataStream & stream, const KPIM::Identity & ident ); - friend QDataStream & operator>>( QDataStream & stream, KPIM::Identity & ident ); + friend TQDataStream & operator<<( TQDataStream & stream, const KPIM::Identity & ident ); + friend TQDataStream & operator>>( TQDataStream & stream, KPIM::Identity & ident ); public: - typedef QValueList<Identity> List; + typedef TQValueList<Identity> List; /** used for comparison */ bool operator==( const Identity & other ) const; @@ -125,11 +125,11 @@ public: } /** Constructor */ - explicit Identity( const QString & id=QString::null, - const QString & realName=QString::null, - const QString & emailAddr=QString::null, - const QString & organization=QString::null, - const QString & replyToAddress=QString::null ); + explicit Identity( const TQString & id=TQString::null, + const TQString & realName=TQString::null, + const TQString & emailAddr=TQString::null, + const TQString & organization=TQString::null, + const TQString & replyToAddress=TQString::null ); /** Destructor */ ~Identity(); @@ -148,8 +148,8 @@ public: bool mailingAllowed() const; /** Identity/nickname for this collection */ - QString identityName() const { return mIdentity; } - void setIdentityName( const QString & name ); + TQString identityName() const { return mIdentity; } + void setIdentityName( const TQString & name ); /** @return whether this identity is the default identity */ bool isDefault() const { return mIsDefault; } @@ -173,57 +173,57 @@ protected: public: /** Full name of the user */ - QString fullName() const { return mFullName; } - void setFullName(const QString&); + TQString fullName() const { return mFullName; } + void setFullName(const TQString&); /** The user's organization (optional) */ - QString organization() const { return mOrganization; } - void setOrganization(const QString&); + TQString organization() const { return mOrganization; } + void setOrganization(const TQString&); - KDE_DEPRECATED QCString pgpIdentity() const { return pgpEncryptionKey(); } - KDE_DEPRECATED void setPgpIdentity( const QCString & key ) { + KDE_DEPRECATED TQCString pgpIdentity() const { return pgpEncryptionKey(); } + KDE_DEPRECATED void setPgpIdentity( const TQCString & key ) { setPGPEncryptionKey( key ); setPGPSigningKey( key ); } /** The user's OpenPGP encryption key */ - QCString pgpEncryptionKey() const { return mPGPEncryptionKey; } - void setPGPEncryptionKey( const QCString & key ); + TQCString pgpEncryptionKey() const { return mPGPEncryptionKey; } + void setPGPEncryptionKey( const TQCString & key ); /** The user's OpenPGP signing key */ - QCString pgpSigningKey() const { return mPGPSigningKey; } - void setPGPSigningKey( const QCString & key ); + TQCString pgpSigningKey() const { return mPGPSigningKey; } + void setPGPSigningKey( const TQCString & key ); /** The user's S/MIME encryption key */ - QCString smimeEncryptionKey() const { return mSMIMEEncryptionKey; } - void setSMIMEEncryptionKey( const QCString & key ); + TQCString smimeEncryptionKey() const { return mSMIMEEncryptionKey; } + void setSMIMEEncryptionKey( const TQCString & key ); /** The user's S/MIME signing key */ - QCString smimeSigningKey() const { return mSMIMESigningKey; } - void setSMIMESigningKey( const QCString & key ); + TQCString smimeSigningKey() const { return mSMIMESigningKey; } + void setSMIMESigningKey( const TQCString & key ); Kleo::CryptoMessageFormat preferredCryptoMessageFormat() const { return mPreferredCryptoMessageFormat; } void setPreferredCryptoMessageFormat( Kleo::CryptoMessageFormat format ) { mPreferredCryptoMessageFormat = format; } /** email address (without the user name - only name\@host) */ - QString emailAddr() const { return mEmailAddr; } - void setEmailAddr(const QString&); + TQString emailAddr() const { return mEmailAddr; } + void setEmailAddr(const TQString&); /** vCard to attach to outgoing emails */ - QString vCardFile() const { return mVCardFile; } - void setVCardFile(const QString&); + TQString vCardFile() const { return mVCardFile; } + void setVCardFile(const TQString&); /** email address in the format "username <name@host>" suitable for the "From:" field of email messages. */ - QString fullEmailAddr() const; + TQString fullEmailAddr() const; /** email address for the ReplyTo: field */ - QString replyToAddr() const { return mReplyToAddr; } - void setReplyToAddr(const QString&); + TQString replyToAddr() const { return mReplyToAddr; } + void setReplyToAddr(const TQString&); /** email addresses for the BCC: field */ - QString bcc() const { return mBcc; } - void setBcc(const QString& aBcc) { mBcc = aBcc; } + TQString bcc() const { return mBcc; } + void setBcc(const TQString& aBcc) { mBcc = aBcc; } void setSignature( const Signature & sig ) { mSignature = sig; } Signature & signature() /* _not_ const! */ { return mSignature; } @@ -238,12 +238,12 @@ protected: bool signatureIsInline() const { return mSignature.type() == Signature::Inlined; } /** name of the signature file (with path) */ - QString signatureFile() const { return mSignature.url(); } - void setSignatureFile(const QString&); + TQString signatureFile() const { return mSignature.url(); } + void setSignatureFile(const TQString&); /** inline signature */ - QString signatureInlineText() const { return mSignature.text();} - void setSignatureInlineText(const QString&); + TQString signatureInlineText() const { return mSignature.text();} + void setSignatureInlineText(const TQString&); /** Inline or signature from a file */ bool useSignatureFile() const { return signatureIsPlainFile() || signatureIsCommand(); } @@ -254,35 +254,35 @@ public: correct. So use this method to rectreive the contents of the signature file. If @p prompt is false, no errors will be displayed (useful for retries). */ - QString signatureText( bool * ok=0) const; + TQString signatureText( bool * ok=0) const; /** The transport that is set for this identity. Used to link a transport with an identity. */ - QString transport() const { return mTransport; } - void setTransport(const QString&); + TQString transport() const { return mTransport; } + void setTransport(const TQString&); /** The folder where sent messages from this identity will be stored by default. */ - QString fcc() const { return mFcc; } - void setFcc(const QString&); + TQString fcc() const { return mFcc; } + void setFcc(const TQString&); /** The folder where draft messages from this identity will be stored by default. */ - QString drafts() const { return mDrafts; } - void setDrafts(const QString&); + TQString drafts() const { return mDrafts; } + void setDrafts(const TQString&); /** The folder where template messages from this identity will be stored by default. */ - QString templates() const { return mTemplates; } - void setTemplates( const QString& ); + TQString templates() const { return mTemplates; } + void setTemplates( const TQString& ); /** dictionary which should be used for spell checking */ - QString dictionary() const { return mDictionary; } - void setDictionary( const QString& ); + TQString dictionary() const { return mDictionary; } + void setDictionary( const TQString& ); /** a X-Face header for this identity */ - QString xface() const { return mXFace; } - void setXFace( const QString& ); + TQString xface() const { return mXFace; } + void setXFace( const TQString& ); bool isXFaceEnabled() const { return mXFaceEnabled; } void setXFaceEnabled( const bool ); @@ -294,25 +294,25 @@ protected: // isNull(), readConfig() and writeConfig() as well as operator<< // and operator>> accordingly: uint mUoid; - QString mIdentity, mFullName, mEmailAddr, mOrganization; - QString mReplyToAddr; - QString mBcc; - QString mVCardFile; - QCString mPGPEncryptionKey, mPGPSigningKey, mSMIMEEncryptionKey, mSMIMESigningKey; - QString mFcc, mDrafts, mTemplates, mTransport; - QString mDictionary; - QString mXFace; + TQString mIdentity, mFullName, mEmailAddr, mOrganization; + TQString mReplyToAddr; + TQString mBcc; + TQString mVCardFile; + TQCString mPGPEncryptionKey, mPGPSigningKey, mSMIMEEncryptionKey, mSMIMESigningKey; + TQString mFcc, mDrafts, mTemplates, mTransport; + TQString mDictionary; + TQString mXFace; bool mXFaceEnabled; Signature mSignature; bool mIsDefault; Kleo::CryptoMessageFormat mPreferredCryptoMessageFormat; }; -KDE_EXPORT QDataStream & operator<<( QDataStream & stream, const KPIM::Signature & sig ); -KDE_EXPORT QDataStream & operator>>( QDataStream & stream, KPIM::Signature & sig ); +KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream, const KPIM::Signature & sig ); +KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream, KPIM::Signature & sig ); -KDE_EXPORT QDataStream & operator<<( QDataStream & stream, const KPIM::Identity & ident ); -KDE_EXPORT QDataStream & operator>>( QDataStream & stream, KPIM::Identity & ident ); +KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream, const KPIM::Identity & ident ); +KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream, KPIM::Identity & ident ); } // namespace KPIM diff --git a/libkpimidentities/identitycombo.cpp b/libkpimidentities/identitycombo.cpp index a7b9cd3ab..55c78e2a6 100644 --- a/libkpimidentities/identitycombo.cpp +++ b/libkpimidentities/identitycombo.cpp @@ -43,17 +43,17 @@ using namespace KPIM; -IdentityCombo::IdentityCombo( IdentityManager* manager, QWidget * parent, const char * name ) - : QComboBox( false, parent, name ), mIdentityManager( manager ) +IdentityCombo::IdentityCombo( IdentityManager* manager, TQWidget * parent, const char * name ) + : TQComboBox( false, parent, name ), mIdentityManager( manager ) { reloadCombo(); reloadUoidList(); - connect( this, SIGNAL(activated(int)), SLOT(slotEmitChanged(int)) ); - connect( manager, SIGNAL(changed()), - SLOT(slotIdentityManagerChanged()) ); + connect( this, TQT_SIGNAL(activated(int)), TQT_SLOT(slotEmitChanged(int)) ); + connect( manager, TQT_SIGNAL(changed()), + TQT_SLOT(slotIdentityManagerChanged()) ); } -QString IdentityCombo::currentIdentityName() const { +TQString IdentityCombo::currentIdentityName() const { return mIdentityManager->identities()[ currentItem() ]; } @@ -65,7 +65,7 @@ void IdentityCombo::setCurrentIdentity( const Identity & identity ) { setCurrentIdentity( identity.uoid() ); } -void IdentityCombo::setCurrentIdentity( const QString & name ) { +void IdentityCombo::setCurrentIdentity( const TQString & name ) { int idx = mIdentityManager->identities().findIndex( name ); if ( idx < 0 ) return; if ( idx == currentItem() ) return; @@ -90,7 +90,7 @@ void IdentityCombo::setCurrentIdentity( uint uoid ) { } void IdentityCombo::reloadCombo() { - QStringList identities = mIdentityManager->identities(); + TQStringList identities = mIdentityManager->identities(); // the IM should prevent this from happening: assert( !identities.isEmpty() ); identities.first() = i18n("%1 (Default)").arg( identities.first() ); diff --git a/libkpimidentities/identitycombo.h b/libkpimidentities/identitycombo.h index 193b81d04..ab7382f5a 100644 --- a/libkpimidentities/identitycombo.h +++ b/libkpimidentities/identitycombo.h @@ -32,8 +32,8 @@ #ifndef _KPIM_IDENTITYCOMBO_H_ #define _KPIM_IDENTITYCOMBO_H_ -#include <qcombobox.h> -#include <qvaluelist.h> +#include <tqcombobox.h> +#include <tqvaluelist.h> #include <kdepimmacros.h> class QString; @@ -48,14 +48,14 @@ class Identity; * @author Marc Mutz <mutz@kde.org> **/ -class KDE_EXPORT IdentityCombo : public QComboBox { +class KDE_EXPORT IdentityCombo : public TQComboBox { Q_OBJECT public: - IdentityCombo( IdentityManager* manager, QWidget * parent=0, const char * name=0 ); + IdentityCombo( IdentityManager* manager, TQWidget * parent=0, const char * name=0 ); - QString currentIdentityName() const; + TQString currentIdentityName() const; uint currentIdentity() const; - void setCurrentIdentity( const QString & identityName ); + void setCurrentIdentity( const TQString & identityName ); void setCurrentIdentity( const Identity & identity ); void setCurrentIdentity( uint uoid ); @@ -65,7 +65,7 @@ signals: * by user intervention or on setCurrentIdentity() or if the * current identity disappears. **/ - void identityChanged( const QString & identityName ); + void identityChanged( const TQString & identityName ); /** @em Really emitted whenever the current identity changes. Either * by user intervention or on setCurrentIdentity() or if the @@ -90,7 +90,7 @@ protected: void reloadUoidList(); protected: - QValueList<uint> mUoidList; + TQValueList<uint> mUoidList; IdentityManager* mIdentityManager; }; diff --git a/libkpimidentities/identitymanager.cpp b/libkpimidentities/identitymanager.cpp index 00f3eae45..4c6ed02ad 100644 --- a/libkpimidentities/identitymanager.cpp +++ b/libkpimidentities/identitymanager.cpp @@ -49,24 +49,24 @@ static const char configKeyDefaultIdentity[] = "Default Identity"; #include <kuser.h> #include <dcopclient.h> -#include <qregexp.h> +#include <tqregexp.h> #include <assert.h> using namespace KPIM; -static QCString newDCOPObjectName() +static TQCString newDCOPObjectName() { static int s_count = 0; - QCString name( "KPIM::IdentityManager" ); + TQCString name( "KPIM::IdentityManager" ); if ( s_count++ ) { name += '-'; - name += QCString().setNum( s_count ); + name += TQCString().setNum( s_count ); } return name; } -IdentityManager::IdentityManager( bool readonly, QObject * parent, const char * name ) +IdentityManager::IdentityManager( bool readonly, TQObject * parent, const char * name ) : ConfigManager( parent, name ), DCOPObject( newDCOPObjectName() ) { mReadOnly = readonly; @@ -91,8 +91,8 @@ IdentityManager::IdentityManager( bool readonly, QObject * parent, const char * } // The emitter is always called KPIM::IdentityManager even if we are not - if ( !connectDCOPSignal( 0, "KPIM::IdentityManager", "identitiesChanged(QCString,QCString)", - "slotIdentitiesChanged(QCString,QCString)", false ) ) + if ( !connectDCOPSignal( 0, "KPIM::IdentityManager", "identitiesChanged(TQCString,TQCString)", + "slotIdentitiesChanged(TQCString,TQCString)", false ) ) kdError(5650) << "IdentityManager: connection to identitiesChanged failed" << endl; } @@ -108,16 +108,16 @@ void IdentityManager::commit() // early out: if ( !hasPendingChanges() || mReadOnly ) return; - QValueList<uint> seenUOIDs; - for ( QValueList<Identity>::ConstIterator it = mIdentities.begin() ; + TQValueList<uint> seenUOIDs; + for ( TQValueList<Identity>::ConstIterator it = mIdentities.begin() ; it != mIdentities.end() ; ++it ) seenUOIDs << (*it).uoid(); - QValueList<uint> changedUOIDs; + TQValueList<uint> changedUOIDs; // find added and changed identities: - for ( QValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ; + for ( TQValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ; it != mShadowIdentities.end() ; ++it ) { - QValueList<uint>::Iterator uoid = seenUOIDs.find( (*it).uoid() ); + TQValueList<uint>::Iterator uoid = seenUOIDs.find( (*it).uoid() ); if ( uoid != seenUOIDs.end() ) { const Identity & orig = identityForUoid( *uoid ); // look it up in mIdentities if ( *it != orig ) { @@ -135,7 +135,7 @@ void IdentityManager::commit() } // what's left are deleted identities: - for ( QValueList<uint>::ConstIterator it = seenUOIDs.begin() ; + for ( TQValueList<uint>::ConstIterator it = seenUOIDs.begin() ; it != seenUOIDs.end() ; ++it ) { kdDebug( 5006 ) << "emitting deleted() for identity " << (*it) << endl; emit deleted( *it ); @@ -146,7 +146,7 @@ void IdentityManager::commit() // now that mIdentities has all the new info, we can emit the added/changed // signals that ship a uoid. This is because the slots might use identityForUoid(uoid)... - for ( QValueList<uint>::ConstIterator it = changedUOIDs.begin() ; + for ( TQValueList<uint>::ConstIterator it = changedUOIDs.begin() ; it != changedUOIDs.end() ; ++it ) emit changed( *it ); @@ -155,10 +155,10 @@ void IdentityManager::commit() // DCOP signal for other IdentityManager instances // The emitter is always set to KPIM::IdentityManager, so that the connect works // This is why we can't use k_dcop_signals here, but need to use emitDCOPSignal - QByteArray data; QDataStream arg( data, IO_WriteOnly ); + TQByteArray data; TQDataStream arg( data, IO_WriteOnly ); arg << kapp->dcopClient()->appId(); arg << DCOPObject::objId(); // the real objId, for checking in slotIdentitiesChanged - kapp->dcopClient()->emitDCOPSignal( "KPIM::IdentityManager", "identitiesChanged(QCString,QCString)", data ); + kapp->dcopClient()->emitDCOPSignal( "KPIM::IdentityManager", "identitiesChanged(TQCString,TQCString)", data ); } void IdentityManager::rollback() @@ -171,18 +171,18 @@ bool IdentityManager::hasPendingChanges() const return mIdentities != mShadowIdentities; } -QStringList IdentityManager::identities() const +TQStringList IdentityManager::identities() const { - QStringList result; + TQStringList result; for ( ConstIterator it = mIdentities.begin() ; it != mIdentities.end() ; ++it ) result << (*it).identityName(); return result; } -QStringList IdentityManager::shadowIdentities() const +TQStringList IdentityManager::shadowIdentities() const { - QStringList result; + TQStringList result; for ( ConstIterator it = mShadowIdentities.begin() ; it != mShadowIdentities.end() ; ++it ) result << (*it).identityName(); @@ -194,14 +194,14 @@ void IdentityManager::sort() { } void IdentityManager::writeConfig() const { - QStringList identities = groupList(mConfig); - for ( QStringList::Iterator group = identities.begin() ; + TQStringList identities = groupList(mConfig); + for ( TQStringList::Iterator group = identities.begin() ; group != identities.end() ; ++group ) mConfig->deleteGroup( *group ); int i = 0; for ( ConstIterator it = mIdentities.begin() ; it != mIdentities.end() ; ++it, ++i ) { - KConfigGroup cg( mConfig, QString::fromLatin1("Identity #%1").arg(i) ); + KConfigGroup cg( mConfig, TQString::fromLatin1("Identity #%1").arg(i) ); (*it).writeConfig( &cg ); if ( (*it).isDefault() ) { // remember which one is default: @@ -223,14 +223,14 @@ void IdentityManager::writeConfig() const { void IdentityManager::readConfig(KConfigBase* config) { mIdentities.clear(); - QStringList identities = groupList(config); + TQStringList identities = groupList(config); if ( identities.isEmpty() ) return; // nothing to be done... KConfigGroup general( config, "General" ); uint defaultIdentity = general.readUnsignedNumEntry( configKeyDefaultIdentity ); bool haveDefault = false; - for ( QStringList::Iterator group = identities.begin() ; + for ( TQStringList::Iterator group = identities.begin() ; group != identities.end() ; ++group ) { KConfigGroup configGroup( config, *group ); mIdentities << Identity(); @@ -249,8 +249,8 @@ void IdentityManager::readConfig(KConfigBase* config) { mShadowIdentities = mIdentities; } -QStringList IdentityManager::groupList(KConfigBase* config) const { - return config->groupList().grep( QRegExp("^Identity #\\d+$") ); +TQStringList IdentityManager::groupList(KConfigBase* config) const { + return config->groupList().grep( TQRegExp("^Identity #\\d+$") ); } IdentityManager::ConstIterator IdentityManager::begin() const { @@ -269,7 +269,7 @@ IdentityManager::Iterator IdentityManager::modifyEnd() { return mShadowIdentities.end(); } -const Identity & IdentityManager::identityForName( const QString & name ) const +const Identity & IdentityManager::identityForName( const TQString & name ) const { kdWarning( 5006 ) << "deprecated method IdentityManager::identityForName() called!" << endl; @@ -284,7 +284,7 @@ const Identity & IdentityManager::identityForUoid( uint uoid ) const { return Identity::null(); } -const Identity & IdentityManager::identityForNameOrDefault( const QString & name ) const +const Identity & IdentityManager::identityForNameOrDefault( const TQString & name ) const { const Identity & ident = identityForName( name ); if ( ident.isNull() ) @@ -302,14 +302,14 @@ const Identity & IdentityManager::identityForUoidOrDefault( uint uoid ) const return ident; } -const Identity & IdentityManager::identityForAddress( const QString & addresses ) const +const Identity & IdentityManager::identityForAddress( const TQString & addresses ) const { - QStringList addressList = KPIM::splitEmailAddrList( addresses ); + TQStringList addressList = KPIM::splitEmailAddrList( addresses ); for ( ConstIterator it = begin() ; it != end() ; ++it ) { - for( QStringList::ConstIterator addrIt = addressList.begin(); + for( TQStringList::ConstIterator addrIt = addressList.begin(); addrIt != addressList.end(); ++addrIt ) { - // I use QString::utf8() instead of QString::latin1() because I want - // a QCString and not a char*. It doesn't matter because emailAddr() + // I use TQString::utf8() instead of TQString::latin1() because I want + // a TQCString and not a char*. It doesn't matter because emailAddr() // returns a 7-bit string. if( (*it).emailAddr().lower() == KPIM::getEmailAddress( *addrIt ).lower() ) { @@ -320,11 +320,11 @@ const Identity & IdentityManager::identityForAddress( const QString & addresses return Identity::null(); } -bool IdentityManager::thatIsMe( const QString & addressList ) const { +bool IdentityManager::thatIsMe( const TQString & addressList ) const { return !identityForAddress( addressList ).isNull(); } -Identity & IdentityManager::modifyIdentityForName( const QString & name ) +Identity & IdentityManager::modifyIdentityForName( const TQString & name ) { for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it ) if ( (*it).identityName() == name ) return (*it); @@ -350,9 +350,9 @@ const Identity & IdentityManager::defaultIdentity() const { return *begin(); } -bool IdentityManager::setAsDefault( const QString & name ) { +bool IdentityManager::setAsDefault( const TQString & name ) { // First, check if the identity actually exists: - QStringList names = shadowIdentities(); + TQStringList names = shadowIdentities(); if ( names.find( name ) == names.end() ) return false; // Then, change the default as requested: for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it ) @@ -381,7 +381,7 @@ bool IdentityManager::setAsDefault( uint uoid ) { return true; } -bool IdentityManager::removeIdentity( const QString & name ) { +bool IdentityManager::removeIdentity( const TQString & name ) { for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it ) if ( (*it).identityName() == name ) { bool removedWasDefault = (*it).isDefault(); @@ -393,11 +393,11 @@ bool IdentityManager::removeIdentity( const QString & name ) { return false; } -Identity & IdentityManager::newFromScratch( const QString & name ) { +Identity & IdentityManager::newFromScratch( const TQString & name ) { return newFromExisting( Identity( name ) ); } -Identity & IdentityManager::newFromControlCenter( const QString & name ) { +Identity & IdentityManager::newFromControlCenter( const TQString & name ) { KEMailSettings es; es.setProfile( es.defaultProfileName() ); @@ -410,7 +410,7 @@ Identity & IdentityManager::newFromControlCenter( const QString & name ) { } Identity & IdentityManager::newFromExisting( const Identity & other, - const QString & name ) { + const TQString & name ) { mShadowIdentities << other; Identity & result = mShadowIdentities.last(); result.setIsDefault( false ); // we don't want two default identities! @@ -421,7 +421,7 @@ Identity & IdentityManager::newFromExisting( const Identity & other, } void IdentityManager::createDefaultIdentity() { - QString fullName, emailAddress; + TQString fullName, emailAddress; bool done = false; // Check if the application has any settings @@ -445,12 +445,12 @@ void IdentityManager::createDefaultIdentity() { emailAddress = user.loginName(); if ( !emailAddress.isEmpty() ) { KConfigGroup general( mConfig, "General" ); - QString defaultdomain = general.readEntry( "Default domain" ); + TQString defaultdomain = general.readEntry( "Default domain" ); if( !defaultdomain.isEmpty() ) { emailAddress += '@' + defaultdomain; } else { - emailAddress = QString::null; + emailAddress = TQString::null; } } } @@ -471,15 +471,15 @@ int IdentityManager::newUoid() int uoid; // determine the UOIDs of all saved identities - QValueList<uint> usedUOIDs; - for ( QValueList<Identity>::ConstIterator it = mIdentities.begin() ; + TQValueList<uint> usedUOIDs; + for ( TQValueList<Identity>::ConstIterator it = mIdentities.begin() ; it != mIdentities.end() ; ++it ) usedUOIDs << (*it).uoid(); if ( hasPendingChanges() ) { // add UOIDs of all shadow identities. Yes, we will add a lot of duplicate // UOIDs, but avoiding duplicate UOIDs isn't worth the effort. - for ( QValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ; + for ( TQValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ; it != mShadowIdentities.end() ; ++it ) { usedUOIDs << (*it).uoid(); } @@ -495,16 +495,16 @@ int IdentityManager::newUoid() return uoid; } -QStringList KPIM::IdentityManager::allEmails() const +TQStringList KPIM::IdentityManager::allEmails() const { - QStringList lst; + TQStringList lst; for ( ConstIterator it = begin() ; it != end() ; ++it ) { lst << (*it).emailAddr(); } return lst; } -void KPIM::IdentityManager::slotIdentitiesChanged( QCString appId, QCString objId ) +void KPIM::IdentityManager::slotIdentitiesChanged( TQCString appId, TQCString objId ) { // From standalone kmail to standalone korganizer, the appId will differ // From kontact the appId will match, so we need to test the objId diff --git a/libkpimidentities/identitymanager.h b/libkpimidentities/identitymanager.h index b07ba7434..59b2d1c74 100644 --- a/libkpimidentities/identitymanager.h +++ b/libkpimidentities/identitymanager.h @@ -33,7 +33,7 @@ #include <libkdepim/configmanager.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <dcopobject.h> #include <kdepimmacros.h> @@ -65,12 +65,12 @@ public: * This means in particular that if there is no identity configured, * the default identity created here will not be saved. */ - IdentityManager( bool readonly = false, QObject * parent=0, const char * name=0 ); + IdentityManager( bool readonly = false, TQObject * parent=0, const char * name=0 ); virtual ~IdentityManager(); public: - typedef QValueList<Identity>::Iterator Iterator; - typedef QValueList<Identity>::ConstIterator ConstIterator; + typedef TQValueList<Identity>::Iterator Iterator; + typedef TQValueList<Identity>::ConstIterator ConstIterator; /** Commit changes to disk and emit changed() if necessary. */ void commit(); @@ -81,14 +81,14 @@ public: bool hasPendingChanges() const; /** @return the list of identities */ - QStringList identities() const; + TQStringList identities() const; /** Convenience method. @return the list of (shadow) identities, ie. the ones currently under configuration. */ - QStringList shadowIdentities() const; + TQStringList shadowIdentities() const; /** Sort the identities by name (the default is always first). This operates on the @em shadow list, so you need to @ref commit for @@ -99,19 +99,19 @@ public: /** @return an identity whose address matches any in @p addresses or @ref Identity::null if no such identity exists. **/ - const Identity & identityForAddress( const QString & addresses ) const; + const Identity & identityForAddress( const TQString & addresses ) const; /** @return true if @p addressList contains any of our addresses, false otherwise. @see #identityForAddress **/ - bool thatIsMe( const QString & addressList ) const; + bool thatIsMe( const TQString & addressList ) const; /** @deprecated @return the identity named @p identityName or @ref Identity::null if not found. **/ - const Identity & identityForName( const QString & identityName ) const; + const Identity & identityForName( const TQString & identityName ) const; /** @return the identity with Unique Object Identifier (UOID) @p uoid or @ref Identity::null if not found. @@ -124,7 +124,7 @@ public: @return the identity named @p identityName or the default identity if not found. **/ - const Identity & identityForNameOrDefault( const QString & identityName ) const; + const Identity & identityForNameOrDefault( const TQString & identityName ) const; /** Convenience menthod. @@ -142,7 +142,7 @@ public: @return false if an identity named @p identityName was not found **/ - bool setAsDefault( const QString & identityName ); + bool setAsDefault( const TQString & identityName ); /** Sets the identity with Unique Object Identifier (UOID) @p uoid to be new the default identity. As usual, use @ref commit to @@ -156,7 +156,7 @@ public: reference to the identity that can be modified. To let others see this change, use @ref commit. **/ - Identity & modifyIdentityForName( const QString & identityName ); + Identity & modifyIdentityForName( const TQString & identityName ); /** @return the identity with Unique Object Identifier (UOID) @p uoid. This method returns a reference to the identity that can @@ -165,7 +165,7 @@ public: Identity & modifyIdentityForUoid( uint uoid ); /** Removes the identity with name @p identityName */ - bool removeIdentity( const QString & identityName ); + bool removeIdentity( const TQString & identityName ); ConstIterator begin() const; ConstIterator end() const; @@ -174,13 +174,13 @@ public: Iterator modifyBegin(); Iterator modifyEnd(); - Identity & newFromScratch( const QString & name ); - Identity & newFromControlCenter( const QString & name ); + Identity & newFromScratch( const TQString & name ); + Identity & newFromControlCenter( const TQString & name ); Identity & newFromExisting( const Identity & other, - const QString & name=QString::null ); + const TQString & name=TQString::null ); /** Returns the list of all email addresses (only name@host) from all identities */ - QStringList allEmails() const; + TQStringList allEmails() const; signals: /** Emitted whenever the identity with Unique Object Identifier @@ -205,28 +205,28 @@ protected: * The parameters are filled with some default values from KUser, * but reimplementations of this method can give them another value. */ - virtual void createDefaultIdentity( QString& /*fullName*/, QString& /*emailAddress*/ ) {} + virtual void createDefaultIdentity( TQString& /*fullName*/, TQString& /*emailAddress*/ ) {} protected slots: void slotRollback() { rollback(); }; protected: /** The list that will be seen by everyone */ - QValueList<Identity> mIdentities; + TQValueList<Identity> mIdentities; /** The list that will be seen by the config dialog */ - QValueList<Identity> mShadowIdentities; + TQValueList<Identity> mShadowIdentities; //k_dcop_signals: -// void identitiesChanged( QCString appId, QCString objId ); +// void identitiesChanged( TQCString appId, TQCString objId ); k_dcop: // Connected to the DCOP signal - void slotIdentitiesChanged( QCString appId, QCString objId ); + void slotIdentitiesChanged( TQCString appId, TQCString objId ); private: void writeConfig() const; void readConfig(KConfigBase* config); - QStringList groupList(KConfigBase* config) const; + TQStringList groupList(KConfigBase* config) const; void createDefaultIdentity(); // returns a new Unique Object Identifier |