diff options
Diffstat (limited to 'libkpgp/kpgpbaseG.cpp')
-rw-r--r-- | libkpgp/kpgpbaseG.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/libkpgp/kpgpbaseG.cpp b/libkpgp/kpgpbaseG.cpp index 0a66a0651..768d5c023 100644 --- a/libkpgp/kpgpbaseG.cpp +++ b/libkpgp/kpgpbaseG.cpp @@ -27,7 +27,7 @@ #include <kprocess.h> #include <kdebug.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <string.h> /* strncmp */ @@ -72,7 +72,7 @@ int BaseG::encsign( Block& block, const KeyIDList& recipients, const char *passphrase ) { - QCString cmd; + TQCString cmd; int exitStatus = 0; if(!recipients.isEmpty() && passphrase != 0) @@ -94,7 +94,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients, { cmd += " --set-filename stdin"; - QCString pgpUser = Module::getKpgp()->user(); + TQCString pgpUser = Module::getKpgp()->user(); if(Module::getKpgp()->encryptToSelf() && !pgpUser.isEmpty()) { cmd += " -r 0x"; cmd += pgpUser; @@ -130,7 +130,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients, int index = 0; bool bad = FALSE; unsigned int num = 0; - QCString badkeys = ""; + TQCString badkeys = ""; // Examples: // gpg: 0x12345678: skipped: public key not found // gpg: 0x12345678: skipped: public key is disabled @@ -266,7 +266,7 @@ BaseG::decrypt( Block& block, const char *passphrase ) index = error.findRev(" \"", index2) + 7; // The conversion from UTF8 is necessary because gpg stores and // prints user IDs in UTF8 - block.setRequiredUserId( QString::fromUtf8( error.mid( index, index2 - index + 1 ) ) ); + block.setRequiredUserId( TQString::fromUtf8( error.mid( index, index2 - index + 1 ) ) ); kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!" << endl; } } @@ -292,7 +292,7 @@ BaseG::decrypt( Block& block, const char *passphrase ) mRecipients.clear(); 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; @@ -324,7 +324,7 @@ BaseG::decrypt( Block& block, const char *passphrase ) { status |= UNKNOWN_SIG; status |= GOODSIG; - block.setSignatureUserId( QString::null ); + block.setSignatureUserId( TQString::null ); } else if( error.find("Good signature", index) != -1 ) { @@ -357,7 +357,7 @@ BaseG::decrypt( Block& block, const char *passphrase ) else { status |= ERROR; - block.setSignatureUserId( QString::null ); + block.setSignatureUserId( TQString::null ); } } //kdDebug(5100) << "status = " << status << endl; @@ -403,15 +403,15 @@ BaseG::readPublicKey( const KeyID& keyID, KeyList -BaseG::publicKeys( const QStringList & patterns ) +BaseG::publicKeys( const TQStringList & patterns ) { int exitStatus = 0; // the option --with-colons should be used for interprocess communication // with gpg (according to Werner Koch) - QCString cmd = "--batch --list-public-keys --with-fingerprint --with-colons " + TQCString cmd = "--batch --list-public-keys --with-fingerprint --with-colons " "--fixed-list-mode --no-expensive-trust-checks"; - for ( QStringList::ConstIterator it = patterns.begin(); + for ( TQStringList::ConstIterator it = patterns.begin(); it != patterns.end(); ++it ) { cmd += " "; cmd += KProcess::quote( *it ).local8Bit(); @@ -435,15 +435,15 @@ BaseG::publicKeys( const QStringList & patterns ) KeyList -BaseG::secretKeys( const QStringList & patterns ) +BaseG::secretKeys( const TQStringList & patterns ) { int exitStatus = 0; // the option --with-colons should be used for interprocess communication // with gpg (according to Werner Koch) - QCString cmd = "--batch --list-secret-keys --with-fingerprint --with-colons " + TQCString cmd = "--batch --list-secret-keys --with-fingerprint --with-colons " "--fixed-list-mode"; - for ( QStringList::ConstIterator it = patterns.begin(); + for ( TQStringList::ConstIterator it = patterns.begin(); it != patterns.end(); ++it ) { cmd += " "; cmd += KProcess::quote( *it ).local8Bit(); @@ -469,7 +469,7 @@ BaseG::secretKeys( const QStringList & patterns ) int BaseG::signKey(const KeyID& keyID, const char *passphrase) { - QCString cmd; + TQCString cmd; int exitStatus = 0; cmd = "--batch"; @@ -493,14 +493,14 @@ BaseG::getAsciiPublicKey(const KeyID& keyID) int exitStatus = 0; if (keyID.isEmpty()) - return QCString(); + return TQCString(); status = 0; exitStatus = runGpg("--batch --armor --export 0x" + keyID, 0, true); if(exitStatus != 0) { status = ERROR; - return QCString(); + return TQCString(); } return output; @@ -508,7 +508,7 @@ BaseG::getAsciiPublicKey(const KeyID& keyID) Key* -BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) +BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) // This function parses the data for a single key which is output by GnuPG // with the following command line arguments: // --batch --list-public-keys --with-fingerprint --with-colons @@ -529,7 +529,7 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) else key->clear(); - QCString keyID; + TQCString keyID; bool firstKey = true; while( true ) @@ -552,7 +552,7 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) key->setSecret( !bIsPublicKey ); - Subkey *subkey = new Subkey( QCString(), !bIsPublicKey ); + Subkey *subkey = new Subkey( TQCString(), !bIsPublicKey ); int pos = index + 4; // begin of 2nd field int pos2 = output.find( ':', pos ); @@ -709,22 +709,22 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) case 9: break; case 10: // User-ID - QCString uid = output.mid( pos, pos2-pos ); + TQCString uid = output.mid( pos, pos2-pos ); // replace "\xXX" with the corresponding character; // other escaped characters, i.e. \n, \r etc., are ignored // because they shouldn't appear in user IDs for ( int idx = 0 ; (idx = uid.find( "\\x", idx )) >= 0 ; ++idx ) { char str[2] = "x"; - str[0] = (char) QString( uid.mid( idx + 2, 2 ) ).toShort( 0, 16 ); + str[0] = (char) TQString( uid.mid( idx + 2, 2 ) ).toShort( 0, 16 ); uid.replace( idx, 4, str ); } - QString uidString = QString::fromUtf8( uid.data() ); + TQString uidString = TQString::fromUtf8( uid.data() ); // check whether uid was utf-8 encoded bool isUtf8 = true; for ( unsigned int i = 0; i + 1 < uidString.length(); ++i ) { if ( uidString[i].unicode() == 0xdbff && uidString[i+1].row() == 0xde ) { - // we found a non-Unicode character (see QString::fromUtf8()) + // we found a non-Unicode character (see TQString::fromUtf8()) isUtf8 = false; break; } @@ -755,7 +755,7 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) if( nonAsciiCount > asciiCount ) { // assume koi8-r encoding kdDebug(5100) << "Assume koi8-r encoding." << endl; - QTextCodec *codec = QTextCodec::codecForName("KOI8-R"); + TQTextCodec *codec = TQTextCodec::codecForName("KOI8-R"); uidString = codec->toUnicode( uid.data() ); // check the case of the first two characters to find out // whether the user id is probably CP1251 encoded (for some @@ -771,14 +771,14 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) // CP1251 encoding kdDebug(5100) << "No, it doesn't seem to be koi8-r. " "Use CP 1251 instead." << endl; - QTextCodec *codec = QTextCodec::codecForName("CP1251"); + TQTextCodec *codec = TQTextCodec::codecForName("CP1251"); uidString = codec->toUnicode( uid.data() ); } } else { // assume latin1 encoding kdDebug(5100) << "Assume latin1 encoding." << endl; - uidString = QString::fromLatin1( uid.data() ); + uidString = TQString::fromLatin1( uid.data() ); } } userID->setText( uidString ); @@ -818,7 +818,7 @@ BaseG::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) KeyList -BaseG::parseKeyList( const QCString& output, bool secretKeys ) +BaseG::parseKeyList( const TQCString& output, bool secretKeys ) { KeyList keys; Key *key = 0; |