From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkpgp/kpgpbase5.cpp | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'libkpgp/kpgpbase5.cpp') diff --git a/libkpgp/kpgpbase5.cpp b/libkpgp/kpgpbase5.cpp index c67dfd29b..21ca1dc47 100644 --- a/libkpgp/kpgpbase5.cpp +++ b/libkpgp/kpgpbase5.cpp @@ -26,8 +26,8 @@ #include /* strncmp */ #include -#include -#include +#include +#include #include #include @@ -65,7 +65,7 @@ int Base5::encsign( Block& block, const KeyIDList& recipients, const char *passphrase ) { - QCString cmd; + TQCString cmd; int exitStatus = 0; int index; // used to work around a bug in pgp5. pgp5 treats files @@ -112,7 +112,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, if (signonly) { input.append("\n"); - input.replace(QRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace + input.replace(TQRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace } //We have to do this otherwise it's all in vain @@ -131,7 +131,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, } //if(!ignoreUntrusted) //{ - QCString aStr; + TQCString aStr; index = -1; while((index = error.find("WARNING: The above key",index+1)) != -1) { @@ -168,7 +168,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, errMsg = i18n("Missing encryption key(s) for:\n%1") .arg(error.mid(index,index2-index)); -// errMsg = QString("Missing encryption key(s) for: %1") +// errMsg = TQString("Missing encryption key(s) for: %1") // .arg(error.mid(index,index2-index)); status |= ERROR; status |= MISSINGKEY; @@ -252,7 +252,7 @@ Base5::decrypt( Block& block, const char *passphrase ) int index2; while( (index2 = error.find('\n',index+1)) <= end ) { - QCString item = error.mid(index+1,index2-index-1); + TQCString item = error.mid(index+1,index2-index-1); item.stripWhiteSpace(); mRecipients.append(item); index = index2; @@ -303,7 +303,7 @@ Base5::decrypt( Block& block, const char *passphrase ) { index = error.find("keyid: 0x",index) + 9; block.setSignatureKeyId( error.mid(index, 8) ); - block.setSignatureUserId( QString::null ); + block.setSignatureUserId( TQString::null ); // FIXME: not a very good solution... status |= SIGNED; status |= GOODSIG; @@ -355,12 +355,12 @@ Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key ) KeyList -Base5::publicKeys( const QStringList & patterns ) +Base5::publicKeys( const TQStringList & patterns ) { int exitStatus = 0; - QCString cmd = "pgpk -ll"; - for ( QStringList::ConstIterator it = patterns.begin(); + TQCString cmd = "pgpk -ll"; + for ( TQStringList::ConstIterator it = patterns.begin(); it != patterns.end(); ++it ) { cmd += " "; cmd += KProcess::quote( *it ).local8Bit(); @@ -384,13 +384,13 @@ Base5::publicKeys( const QStringList & patterns ) KeyList -Base5::secretKeys( const QStringList & patterns ) +Base5::secretKeys( const TQStringList & patterns ) { int exitStatus = 0; status = 0; - QCString cmd = "pgpk -ll"; - for ( QStringList::ConstIterator it = patterns.begin(); + TQCString cmd = "pgpk -ll"; + for ( TQStringList::ConstIterator it = patterns.begin(); it != patterns.end(); ++it ) { cmd += " "; cmd += KProcess::quote( *it ).local8Bit(); @@ -413,19 +413,19 @@ Base5::secretKeys( const QStringList & patterns ) } -QCString Base5::getAsciiPublicKey(const KeyID& keyID) +TQCString Base5::getAsciiPublicKey(const KeyID& keyID) { int exitStatus = 0; if (keyID.isEmpty()) - return QCString(); + return TQCString(); status = 0; exitStatus = run( "pgpk -xa 0x" + keyID, 0, true ); if(exitStatus != 0) { status = ERROR; - return QCString(); + return TQCString(); } return output; @@ -435,7 +435,7 @@ QCString Base5::getAsciiPublicKey(const KeyID& keyID) int Base5::signKey(const KeyID& keyID, const char *passphrase) { - QCString cmd; + TQCString cmd; int exitStatus = 0; if(passphrase == 0) return false; @@ -456,7 +456,7 @@ Base5::signKey(const KeyID& keyID, const char *passphrase) //-- private functions -------------------------------------------------------- Key* -Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) +Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) // This function parses the data for a single key which is output by PGP 5 // with the following command line: // pgpk -ll @@ -546,8 +546,8 @@ Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) int year = output.mid( pos, 4 ).toInt(); int month = output.mid( pos+5, 2 ).toInt(); int day = output.mid( pos+8, 2 ).toInt(); - QDateTime dt( QDate( year, month, day ), QTime( 00, 00 ) ); - QDateTime epoch( QDate( 1970, 01, 01 ), QTime( 00, 00 ) ); + TQDateTime dt( TQDate( year, month, day ), TQTime( 00, 00 ) ); + TQDateTime epoch( TQDate( 1970, 01, 01 ), TQTime( 00, 00 ) ); // The calculated creation date isn't exactly correct because QDateTime // doesn't know anything about timezones and always assumes local time // although epoch is of course UTC. But as PGP 5 anyway doesn't print @@ -576,10 +576,10 @@ Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) int year = output.mid( pos, 4 ).toInt(); int month = output.mid( pos+5, 2 ).toInt(); int day = output.mid( pos+8, 2 ).toInt(); - QDateTime dt( QDate( year, month, day ), QTime( 00, 00 ) ); + TQDateTime dt( TQDate( year, month, day ), TQTime( 00, 00 ) ); subkey->setCreationDate( epoch.secsTo( dt ) ); // has the key already expired? - if( QDateTime::currentDateTime() >= dt ) + if( TQDateTime::currentDateTime() >= dt ) { subkey->setExpired( true ); key->setExpired( true ); @@ -654,7 +654,7 @@ Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) */ int pos = output.find( '=', offset+3 ) + 2; - QCString fingerprint = output.mid( pos, eol-pos ); + TQCString fingerprint = output.mid( pos, eol-pos ); // remove white space from the fingerprint for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) fingerprint.replace( idx, 1, "" ); @@ -665,7 +665,7 @@ Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) else if( !strncmp( output.data() + offset, "uid", 3 ) ) { // line contains a uid int pos = offset+5; - QCString uid = output.mid( pos, eol-pos ); + TQCString uid = output.mid( pos, eol-pos ); key->addUserID( uid ); // displaying of uids which contain non-ASCII characters is broken in // PGP 5.0i; it shows these characters as \ooo and truncates the uid @@ -691,7 +691,7 @@ Base5::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) Key* -Base5::parseSingleKey( const QCString& output, Key* key /* = 0 */ ) +Base5::parseSingleKey( const TQCString& output, Key* key /* = 0 */ ) { int offset; @@ -719,7 +719,7 @@ Base5::parseSingleKey( const QCString& output, Key* key /* = 0 */ ) KeyList -Base5::parseKeyList( const QCString& output, bool onlySecretKeys ) +Base5::parseKeyList( const TQCString& output, bool onlySecretKeys ) { KeyList keys; Key *key = 0; @@ -761,12 +761,12 @@ Base5::parseKeyList( const QCString& output, bool onlySecretKeys ) void -Base5::parseTrustDataForKey( Key* key, const QCString& str ) +Base5::parseTrustDataForKey( Key* key, const TQCString& str ) { if( ( key == 0 ) || str.isEmpty() ) return; - QCString keyID = "0x" + key->primaryKeyID(); + TQCString keyID = "0x" + key->primaryKeyID(); UserIDList userIDs = key->userIDs(); // search the start of the trust data @@ -808,7 +808,7 @@ Base5::parseTrustDataForKey( Key* key, const QCString& str ) // determine the user ID int pos = offset + 33; - QString uid = str.mid( pos, eol-pos ); + TQString uid = str.mid( pos, eol-pos ); // set the validity of the corresponding user ID for( UserIDListIterator it( userIDs ); it.current(); ++it ) -- cgit v1.2.1