summaryrefslogtreecommitdiffstats
path: root/libkpimidentities/identity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkpimidentities/identity.cpp')
-rw-r--r--libkpimidentities/identity.cpp120
1 files changed, 60 insertions, 60 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;
}