diff options
Diffstat (limited to 'libkpgp')
-rw-r--r-- | libkpgp/kpgp.cpp | 204 | ||||
-rw-r--r-- | libkpgp/kpgp.h | 100 | ||||
-rw-r--r-- | libkpgp/kpgpbase.cpp | 30 | ||||
-rw-r--r-- | libkpgp/kpgpbase.h | 78 | ||||
-rw-r--r-- | libkpgp/kpgpbase2.cpp | 62 | ||||
-rw-r--r-- | libkpgp/kpgpbase5.cpp | 60 | ||||
-rw-r--r-- | libkpgp/kpgpbase6.cpp | 50 | ||||
-rw-r--r-- | libkpgp/kpgpbaseG.cpp | 56 | ||||
-rw-r--r-- | libkpgp/kpgpblock.cpp | 22 | ||||
-rw-r--r-- | libkpgp/kpgpblock.h | 86 | ||||
-rw-r--r-- | libkpgp/kpgpkey.cpp | 24 | ||||
-rw-r--r-- | libkpgp/kpgpkey.h | 80 | ||||
-rw-r--r-- | libkpgp/kpgpui.cpp | 450 | ||||
-rw-r--r-- | libkpgp/kpgpui.h | 126 |
14 files changed, 714 insertions, 714 deletions
diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp index d478d1999..ec80e6887 100644 --- a/libkpgp/kpgp.cpp +++ b/libkpgp/kpgp.cpp @@ -30,9 +30,9 @@ #include <sys/wait.h> #include <signal.h> -#include <qlabel.h> -#include <qcursor.h> -#include <qapplication.h> +#include <tqlabel.h> +#include <tqcursor.h> +#include <tqapplication.h> #include <kdebug.h> #include <klocale.h> @@ -200,14 +200,14 @@ Module::prepare( bool needPassPhrase, Block* block ) setPassPhrase( "dummy" ); } else { - QString ID; + TQString ID; if( block ) ID = block->requiredUserId(); PassphraseDialog passdlg(0, i18n("OpenPGP Security Check"), true, ID); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int passdlgResult = passdlg.exec(); - QApplication::restoreOverrideCursor(); - if (passdlgResult == QDialog::Accepted) { + TQApplication::restoreOverrideCursor(); + if (passdlgResult == TQDialog::Accepted) { if (!setPassPhrase(passdlg.passphrase())) { if (strlen(passdlg.passphrase()) >= 1024) errMsg = i18n("Passphrase is too long, it must contain fewer than 1024 characters."); @@ -281,13 +281,13 @@ Module::decrypt( Block& block ) // loop on bad passphrase if( retval & BADPHRASE ) { wipePassPhrase(); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningContinueCancel(0, i18n("You just entered an invalid passphrase.\n" "Do you want to try again, or " "cancel and view the message undecrypted?"), i18n("PGP Warning"), i18n("&Retry")); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if ( ret == KMessageBox::Cancel ) break; } else break; @@ -306,15 +306,15 @@ Module::decrypt( Block& block ) Kpgp::Result Module::clearsign( Block& block, - const KeyID& keyId, const QCString& charset ) + const KeyID& keyId, const TQCString& charset ) { - return encrypt( block, QStringList(), keyId, true, charset ); + return encrypt( block, TQStringList(), keyId, true, charset ); } Kpgp::Result Module::encrypt( Block& block, - const QStringList& receivers, const KeyID& keyId, - bool sign, const QCString& charset ) + const TQStringList& receivers, const KeyID& keyId, + bool sign, const TQCString& charset ) { KeyIDList encryptionKeyIds; // list of keys which are used for encryption int status = 0; @@ -340,15 +340,15 @@ Module::encrypt( Block& block, // check for bad passphrase while( status & BADPHRASE ) { wipePassPhrase(); - QString str = i18n("You entered an invalid passphrase.\n" + TQString str = i18n("You entered an invalid passphrase.\n" "Do you want to try again, continue and leave the " "message unsigned, or cancel sending the message?"); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningYesNoCancel( 0, str, i18n("PGP Warning"), i18n("&Retry"), i18n("Send &Unsigned") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -368,15 +368,15 @@ Module::encrypt( Block& block, // did signing fail? if( status & ERR_SIGNING ) { - QString str = i18n("%1 = 'signing failed' error message", + TQString str = i18n("%1 = 'signing failed' error message", "%1\nDo you want to send the message unsigned, " "or cancel sending the message?") .arg( pgp->lastErrorMessage() ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningContinueCancel( 0, str, i18n("PGP Warning"), i18n("Send &Unsigned") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -386,17 +386,17 @@ Module::encrypt( Block& block, // check for bad keys if( status & BADKEYS ) { - QString str = i18n("%1 = 'bad keys' error message", + TQString str = i18n("%1 = 'bad keys' error message", "%1\nDo you want to encrypt anyway, leave the " "message as-is, or cancel sending the message?") .arg( pgp->lastErrorMessage() ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningYesNoCancel( 0, str, i18n("PGP Warning"), i18n("Send &Encrypted"), i18n("Send &Unencrypted") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -413,15 +413,15 @@ Module::encrypt( Block& block, } if( status & MISSINGKEY ) { - QString str = i18n("%1 = 'missing keys' error message", + TQString str = i18n("%1 = 'missing keys' error message", "%1\nDo you want to leave the message as-is, " "or cancel sending the message?") .arg( pgp->lastErrorMessage() ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningContinueCancel( 0, str, i18n("PGP Warning"), i18n("&Send As-Is") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -433,23 +433,23 @@ Module::encrypt( Block& block, // show error dialog errMsg = i18n( "The following error occurred:\n%1" ) .arg( pgp->lastErrorMessage() ); - QString details = i18n( "This is the error message of %1:\n%2" ) + TQString details = i18n( "This is the error message of %1:\n%2" ) .arg( ( pgpType == tGPG ) ? "GnuPG" : "PGP" ) .arg( block.error().data() ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); KMessageBox::detailedSorry( 0, errMsg, details ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return Kpgp::Failure; } if( showCipherText() ) { // show cipher text dialog CipherTextDialog *cipherTextDlg = new CipherTextDialog( block.text(), charset ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); - bool result = ( cipherTextDlg->exec() == QDialog::Accepted ); - QApplication::restoreOverrideCursor(); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); + bool result = ( cipherTextDlg->exec() == TQDialog::Accepted ); + TQApplication::restoreOverrideCursor(); delete cipherTextDlg; - return result == QDialog::Accepted ? Kpgp::Ok : Kpgp::Canceled; + return result == TQDialog::Accepted ? Kpgp::Ok : Kpgp::Canceled; } return Kpgp::Ok; } @@ -487,7 +487,7 @@ Module::doEncSign( Block& block, Kpgp::Result Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, - const QStringList& recipients, + const TQStringList& recipients, const KeyID& keyId ) { if( recipients.empty() ) { @@ -497,7 +497,7 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, // list of lists of encryption keys (one list per recipient + one list // for the sender) - QValueVector<KeyIDList> recipientKeyIds( recipients.count() + 1 ); + TQValueVector<KeyIDList> recipientKeyIds( recipients.count() + 1 ); // add the sender's encryption key(s) to the list of recipient key IDs if( encryptToSelf() ) { recipientKeyIds[0] = KeyIDList( keyId ); @@ -507,7 +507,7 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, } bool showKeysForApproval = false; int i = 1; - for( QStringList::ConstIterator it = recipients.begin(); + for( TQStringList::ConstIterator it = recipients.begin(); it != recipients.end(); ++it, ++i ) { EncryptPref encrPref = encryptionPreference( *it ); if( ( encrPref == UnknownEncryptPref ) || ( encrPref == NeverEncrypt ) ) @@ -521,7 +521,7 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, } kdDebug(5100) << "recipientKeyIds = (\n"; - QValueVector<KeyIDList>::const_iterator kit; + TQValueVector<KeyIDList>::const_iterator kit; for( kit = recipientKeyIds.begin(); kit != recipientKeyIds.end(); ++kit ) { kdDebug(5100) << "( 0x" << (*kit).toStringList().join( ", 0x" ) << " ),\n"; @@ -542,21 +542,21 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, // show the recipients <-> key relation KeyApprovalDialog dlg( recipients, recipientKeyIds, allowedKeys ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = dlg.exec(); - if( ret == QDialog::Rejected ) { - QApplication::restoreOverrideCursor(); + if( ret == TQDialog::Rejected ) { + TQApplication::restoreOverrideCursor(); return Kpgp::Canceled; } recipientKeyIds = dlg.keys(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } // flatten the list of lists of key IDs and count empty key ID lists unsigned int emptyListCount = 0; - for( QValueVector<KeyIDList>::const_iterator it = recipientKeyIds.begin(); + for( TQValueVector<KeyIDList>::const_iterator it = recipientKeyIds.begin(); it != recipientKeyIds.end(); ++it ) { if( (*it).isEmpty() ) { // only count empty key ID lists for the recipients @@ -577,18 +577,18 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, // show a warning if the user didn't select an encryption key for // some of the recipients if( recipientKeyIds.size() == emptyListCount + 1 ) { // (+1 because of the sender's key) - QString str = ( recipients.count() == 1 ) + TQString str = ( recipients.count() == 1 ) ? i18n("You did not select an encryption key for the " "recipient of this message; therefore, the message " "will not be encrypted.") : i18n("You did not select an encryption key for any of the " "recipients of this message; therefore, the message " "will not be encrypted."); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningContinueCancel( 0, str, i18n("PGP Warning"), i18n("Send &Unencrypted") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -596,19 +596,19 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, encryptionKeyIds.clear(); } else if( emptyListCount > 0 ) { - QString str = ( emptyListCount == 1 ) + TQString str = ( emptyListCount == 1 ) ? i18n("You did not select an encryption key for one of " "the recipients; this person will not be able to " "decrypt the message if you encrypt it.") : i18n("You did not select encryption keys for some of " "the recipients; these persons will not be able to " "decrypt the message if you encrypt it." ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); int ret = KMessageBox::warningYesNoCancel( 0, str, i18n("PGP Warning"), i18n("Send &Encrypted"), i18n("Send &Unencrypted") ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( ret == KMessageBox::Cancel ) { return Kpgp::Canceled; } @@ -622,7 +622,7 @@ Module::getEncryptionKeys( KeyIDList& encryptionKeyIds, } int -Module::encryptionPossible( const QStringList& recipients ) +Module::encryptionPossible( const TQStringList& recipients ) { if( 0 == pgp ) assignPGPBase(); @@ -634,7 +634,7 @@ Module::encryptionPossible( const QStringList& recipients ) int noKey = 0, never = 0, unknown = 0, always = 0, aip = 0, ask = 0, askwp = 0; - for( QStringList::ConstIterator it = recipients.begin(); + for( TQStringList::ConstIterator it = recipients.begin(); it != recipients.end(); ++it) { if( haveTrustedEncryptionKey( *it ) ) { EncryptPref encrPref = encryptionPreference( *it ); @@ -739,7 +739,7 @@ Module::publicKey(const KeyID& keyID) } Key* -Module::publicKey( const QString& userID ) +Module::publicKey( const TQString& userID ) { readPublicKeys(); @@ -779,7 +779,7 @@ Module::keyTrust( const KeyID& keyID ) } Validity -Module::keyTrust( const QString& userID ) +Module::keyTrust( const TQString& userID ) { Key *key = publicKey( userID ); @@ -910,8 +910,8 @@ Module::showCipherText(void) const } KeyID -Module::selectSecretKey( const QString& title, - const QString& text, +Module::selectSecretKey( const TQString& title, + const TQString& text, const KeyID& keyId ) { if( 0 == pgp ) { @@ -929,10 +929,10 @@ Module::selectSecretKey( const QString& title, } KeyID -Module::selectPublicKey( const QString& title, - const QString& text /* = QString::null */, +Module::selectPublicKey( const TQString& title, + const TQString& text /* = TQString::null */, const KeyID& oldKeyId /* = KeyID() */, - const QString& address /* = QString::null */, + const TQString& address /* = TQString::null */, const unsigned int allowedKeys /* = AllKeys */ ) { if( 0 == pgp ) { @@ -965,10 +965,10 @@ Module::selectPublicKey( const QString& title, KeyIDList -Module::selectPublicKeys( const QString& title, - const QString& text /* = QString::null */, +Module::selectPublicKeys( const TQString& title, + const TQString& text /* = TQString::null */, const KeyIDList& oldKeyIds /* = KeyIDList() */, - const QString& address /* = QString::null */, + const TQString& address /* = TQString::null */, const unsigned int allowedKeys /* = AllKeys */ ) { if( 0 == pgp ) { @@ -1021,9 +1021,9 @@ Module::getConfig() bool -Module::prepareMessageForDecryption( const QCString& msg, - QPtrList<Block>& pgpBlocks, - QStrList& nonPgpBlocks ) +Module::prepareMessageForDecryption( const TQCString& msg, + TQPtrList<Block>& pgpBlocks, + TQStrList& nonPgpBlocks ) { BlockType pgpBlock = NoPgpBlock; int start = -1; // start of the current PGP block @@ -1104,7 +1104,7 @@ Module::prepareMessageForDecryption( const QCString& msg, // --------------------- private functions ------------------- bool -Module::haveTrustedEncryptionKey( const QString& person ) +Module::haveTrustedEncryptionKey( const TQString& person ) { if( 0 == pgp ) assignPGPBase(); @@ -1112,7 +1112,7 @@ Module::haveTrustedEncryptionKey( const QString& person ) readPublicKeys(); - QString address = canonicalAddress( person ).lower(); + TQString address = canonicalAddress( person ).lower(); // First look for this person's address in the address data dictionary KeyIDList keyIds = keysForAddress( address ); @@ -1164,7 +1164,7 @@ Module::haveTrustedEncryptionKey( const QString& person ) } KeyIDList -Module::getEncryptionKeys( const QString& person ) +Module::getEncryptionKeys( const TQString& person ) { if( 0 == pgp ) assignPGPBase(); @@ -1172,7 +1172,7 @@ Module::getEncryptionKeys( const QString& person ) readPublicKeys(); - QString address = canonicalAddress( person ).lower(); + TQString address = canonicalAddress( person ).lower(); // #### FIXME: Until we support encryption with untrusted keys only // #### trusted keys are allowed @@ -1325,8 +1325,8 @@ bool Module::checkForPGP(void) { // get path - QCString path; - QStrList pSearchPaths; + TQCString path; + TQStrList pSearchPaths; int index = 0; int lastindex = -1; @@ -1341,7 +1341,7 @@ Module::checkForPGP(void) if(lastindex != (int)path.length() - 1) pSearchPaths.append( path.mid(lastindex+1,path.length()-lastindex) ); - QStrListIterator it(pSearchPaths); + TQStrListIterator it(pSearchPaths); haveGpg=FALSE; // lets try gpg @@ -1479,11 +1479,11 @@ Module::assignPGPBase(void) } QString -Module::canonicalAddress( const QString& _adress ) +Module::canonicalAddress( const TQString& _adress ) { int index,index2; - QString address = _adress.simplifyWhiteSpace(); + TQString address = _adress.simplifyWhiteSpace(); address = address.stripWhiteSpace(); // just leave pure e-mail address. @@ -1597,8 +1597,8 @@ Module::readSecretKeys( bool reread ) KeyID Module::selectKey( const KeyList& keys, - const QString& title, - const QString& text /* = QString::null */ , + const TQString& title, + const TQString& text /* = TQString::null */ , const KeyID& keyId /* = KeyID() */ , const unsigned int allowedKeys /* = AllKeys */ ) { @@ -1607,9 +1607,9 @@ Module::selectKey( const KeyList& keys, KeySelectionDialog dlg( keys, title, text, KeyIDList( keyId ), false, allowedKeys, false ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); - bool rej = ( dlg.exec() == QDialog::Rejected ); - QApplication::restoreOverrideCursor(); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); + bool rej = ( dlg.exec() == TQDialog::Rejected ); + TQApplication::restoreOverrideCursor(); if( !rej ) { retval = dlg.key(); @@ -1620,8 +1620,8 @@ Module::selectKey( const KeyList& keys, KeyIDList Module::selectKeys( const KeyList& keys, - const QString& title, - const QString& text /* = QString::null */ , + const TQString& title, + const TQString& text /* = TQString::null */ , const KeyIDList& keyIds /* = KeyIDList() */ , const unsigned int allowedKeys /* = AllKeys */ ) { @@ -1630,9 +1630,9 @@ Module::selectKeys( const KeyList& keys, KeySelectionDialog dlg( keys, title, text, keyIds, false, allowedKeys, true ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); - bool rej = ( dlg.exec() == QDialog::Rejected ); - QApplication::restoreOverrideCursor(); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); + bool rej = ( dlg.exec() == TQDialog::Rejected ); + TQApplication::restoreOverrideCursor(); if( !rej ) { retval = dlg.keys(); @@ -1645,8 +1645,8 @@ Module::selectKeys( const KeyList& keys, KeyID Module::selectKey( bool& rememberChoice, const KeyList& keys, - const QString& title, - const QString& text /* = QString::null */ , + const TQString& title, + const TQString& text /* = TQString::null */ , const KeyID& keyId /* = KeyID() */ , const unsigned int allowedKeys /* = AllKeys */ ) { @@ -1655,9 +1655,9 @@ Module::selectKey( bool& rememberChoice, KeySelectionDialog dlg( keys, title, text, KeyIDList( keyId ), false, allowedKeys, false ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); - bool rej = ( dlg.exec() == QDialog::Rejected ); - QApplication::restoreOverrideCursor(); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); + bool rej = ( dlg.exec() == TQDialog::Rejected ); + TQApplication::restoreOverrideCursor(); if( !rej ) { retval = dlg.key(); @@ -1673,8 +1673,8 @@ Module::selectKey( bool& rememberChoice, KeyIDList Module::selectKeys( bool& rememberChoice, const KeyList& keys, - const QString& title, - const QString& text /* = QString::null */ , + const TQString& title, + const TQString& text /* = TQString::null */ , const KeyIDList& keyIds /* = KeyIDList() */ , const unsigned int allowedKeys /* = AllKeys */ ) { @@ -1683,9 +1683,9 @@ Module::selectKeys( bool& rememberChoice, KeySelectionDialog dlg( keys, title, text, keyIds, true, allowedKeys, true ); - QApplication::setOverrideCursor( QCursor(QCursor::ArrowCursor) ); - bool rej = ( dlg.exec() == QDialog::Rejected ); - QApplication::restoreOverrideCursor(); + TQApplication::setOverrideCursor( TQCursor(TQCursor::ArrowCursor) ); + bool rej = ( dlg.exec() == TQDialog::Rejected ); + TQApplication::restoreOverrideCursor(); if( !rej ) { retval = dlg.keys(); @@ -1699,12 +1699,12 @@ Module::selectKeys( bool& rememberChoice, } KeyIDList -Module::keysForAddress( const QString& address ) +Module::keysForAddress( const TQString& address ) { if( address.isEmpty() ) { return KeyIDList(); } - QString addr = canonicalAddress( address ).lower(); + TQString addr = canonicalAddress( address ).lower(); if( addressDataDict.contains( addr ) ) { return addressDataDict[addr].keyIds; } @@ -1714,12 +1714,12 @@ Module::keysForAddress( const QString& address ) } void -Module::setKeysForAddress( const QString& address, const KeyIDList& keyIds ) +Module::setKeysForAddress( const TQString& address, const KeyIDList& keyIds ) { if( address.isEmpty() ) { return; } - QString addr = canonicalAddress( address ).lower(); + TQString addr = canonicalAddress( address ).lower(); if( addressDataDict.contains( addr ) ) { addressDataDict[addr].keyIds = keyIds; } @@ -1736,7 +1736,7 @@ Module::setKeysForAddress( const QString& address, const KeyIDList& keyIds ) void Module::readAddressData() { - QString address; + TQString address; AddressData data; KConfigGroup general( config, "General" ); @@ -1744,7 +1744,7 @@ Module::readAddressData() addressDataDict.clear(); for( int i=1; i<=num; i++ ) { - KConfigGroup addrGroup( config, QString("Address #%1").arg(i).local8Bit() ); + KConfigGroup addrGroup( config, TQString("Address #%1").arg(i).local8Bit() ); address = addrGroup.readEntry( "Address" ); data.keyIds = KeyIDList::fromStringList( addrGroup.readListEntry( "Key IDs" ) ); data.encrPref = (EncryptPref) addrGroup.readNumEntry( "EncryptionPreference", @@ -1769,7 +1769,7 @@ Module::writeAddressData() for ( i=1, it = addressDataDict.begin(); it != addressDataDict.end(); ++it, i++ ) { - KConfigGroup addrGroup( config, QString("Address #%1").arg(i).local8Bit() ); + KConfigGroup addrGroup( config, TQString("Address #%1").arg(i).local8Bit() ); addrGroup.writeEntry( "Address", it.key() ); addrGroup.writeEntry( "Key IDs", it.data().keyIds.toStringList() ); addrGroup.writeEntry( "EncryptionPreference", it.data().encrPref ); @@ -1779,9 +1779,9 @@ Module::writeAddressData() } EncryptPref -Module::encryptionPreference( const QString& address ) +Module::encryptionPreference( const TQString& address ) { - QString addr = canonicalAddress( address ).lower(); + TQString addr = canonicalAddress( address ).lower(); if( addressDataDict.contains( addr ) ) { return addressDataDict[addr].encrPref; } @@ -1791,13 +1791,13 @@ Module::encryptionPreference( const QString& address ) } void -Module::setEncryptionPreference( const QString& address, +Module::setEncryptionPreference( const TQString& address, const EncryptPref pref ) { if( address.isEmpty() ) { return; } - QString addr = canonicalAddress( address ).lower(); + TQString addr = canonicalAddress( address ).lower(); if( addressDataDict.contains( addr ) ) { addressDataDict[addr].encrPref = pref; } diff --git a/libkpgp/kpgp.h b/libkpgp/kpgp.h index 9b3ade727..b96bb62dc 100644 --- a/libkpgp/kpgp.h +++ b/libkpgp/kpgp.h @@ -20,18 +20,18 @@ #define KPGP_H #include <stdio.h> -#include <qstring.h> -#include <qstrlist.h> -#include <qdialog.h> -#include <qwidget.h> -#include <qcombobox.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlistview.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qmultilineedit.h> -#include <qcheckbox.h> +#include <tqstring.h> +#include <tqstrlist.h> +#include <tqdialog.h> +#include <tqwidget.h> +#include <tqcombobox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlistview.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqmultilineedit.h> +#include <tqcheckbox.h> #include <kdialogbase.h> @@ -112,7 +112,7 @@ public: Ok if everything is o.k. */ Kpgp::Result clearsign( Block& block, - const KeyID& keyId, const QCString& charset = 0 ); + const KeyID& keyId, const TQCString& charset = 0 ); /** encrypts the given OpenPGP block for a list of persons. if sign is true then the block is clearsigned with the key corresponding to the given @@ -123,8 +123,8 @@ public: Ok if everything is o.k. */ Kpgp::Result encrypt( Block& block, - const QStringList& receivers, const KeyID& keyId, - bool sign, const QCString& charset = 0 ); + const TQStringList& receivers, const KeyID& keyId, + bool sign, const TQCString& charset = 0 ); /** Determines the keys which should be used for encrypting the message to the given list of recipients. @@ -134,7 +134,7 @@ public: Ok if everything is o.k. */ Kpgp::Result getEncryptionKeys( KeyIDList& encryptionKeyIds, - const QStringList& recipients, + const TQStringList& recipients, const KeyID& keyId ); /** checks if encrypting to the given list of persons is possible and @@ -146,7 +146,7 @@ public: 2 if encryption is possible, but the user wants to be asked and -1 if there is a conflict which can't be automatically resolved. */ - int encryptionPossible( const QStringList& recipients ); + int encryptionPossible( const TQStringList& recipients ); protected: int doEncSign( Block& block, const KeyIDList& recipientKeyIds, bool sign ); @@ -170,7 +170,7 @@ public: void readSecretKeys( bool reread = false ); /** try to get an ascii armored key block for the given public key */ - QCString getAsciiPublicKey( const KeyID& keyID ); + TQCString getAsciiPublicKey( const KeyID& keyID ); /** Returns the public key with the given key ID or null if no matching key is found. @@ -180,7 +180,7 @@ public: /** Returns the first public key with the given user ID or null if no matching key is found. */ - Key* publicKey( const QString& userID ); + Key* publicKey( const TQString& userID ); /** Returns the secret key with the given key ID or null if no matching key is found. @@ -196,7 +196,7 @@ public: one key have this user id then the first key with this user id will be chosen. */ - Validity keyTrust( const QString& userID ); + Validity keyTrust( const TQString& userID ); /** Returns TRUE if the given key is at least trusted marginally. Otherwise FALSE is returned. @@ -234,7 +234,7 @@ public: void clear(const bool erasePassPhrase = FALSE); /** returns the last error that occurred */ - const QString lastErrorMsg(void) const; + const TQString lastErrorMsg(void) const; // what version of PGP/GPG should we use enum PGPType { tAuto, tGPG, tPGP2, tPGP5, tPGP6, tOff } pgpType; @@ -257,8 +257,8 @@ public: and the (optional) text. If <em>keyId</em> is given, then the corresponding key is selected. */ - KeyID selectSecretKey( const QString& title, - const QString& text = QString::null, + KeyID selectSecretKey( const TQString& title, + const TQString& text = TQString::null, const KeyID& keyId = KeyID() ); /** Shows a key selection dialog with all public keys and the given title @@ -267,10 +267,10 @@ public: chosen key will be stored (if the user wants it to be stored). <em>mode</em> specifies which keys can be selected. */ - KeyID selectPublicKey( const QString& title, - const QString& text = QString::null, + KeyID selectPublicKey( const TQString& title, + const TQString& text = TQString::null, const KeyID& oldKeyId = KeyID(), - const QString& address = QString::null, + const TQString& address = TQString::null, const unsigned int allowedKeys = AllKeys ); /** Shows a key selection dialog with all public keys and the given title @@ -279,10 +279,10 @@ public: chosen key will be stored (if the user wants it to be stored). <em>mode</em> specifies which keys can be selected. */ - KeyIDList selectPublicKeys( const QString& title, - const QString& text = QString::null, + KeyIDList selectPublicKeys( const TQString& title, + const TQString& text = TQString::null, const KeyIDList& oldKeyIds = KeyIDList(), - const QString& address = QString::null, + const TQString& address = TQString::null, const unsigned int allowedKeys = AllKeys ); // FIXME: key management @@ -290,12 +290,12 @@ public: /** Reads the encryption preference for the given address from the config file. */ - EncryptPref encryptionPreference( const QString& address ); + EncryptPref encryptionPreference( const TQString& address ); /** Writes the given encryption preference for the given address to the config file. */ - void setEncryptionPreference( const QString& address, + void setEncryptionPreference( const TQString& address, const EncryptPref pref ); // -- static member functions -------------------------------------------- @@ -320,16 +320,16 @@ public: (n+1)-th Non-OpenPGP block </pre> */ - static bool prepareMessageForDecryption( const QCString& msg, - QPtrList<Block>& pgpBlocks, - QStrList& nonPgpBlocks ); + static bool prepareMessageForDecryption( const TQCString& msg, + TQPtrList<Block>& pgpBlocks, + TQStrList& nonPgpBlocks ); private: /** check if we have a trusted encryption key for the given person */ - bool haveTrustedEncryptionKey( const QString& person ); + bool haveTrustedEncryptionKey( const TQString& person ); /** get a list of encryption keys to be used for the given recipient */ - KeyIDList getEncryptionKeys( const QString& person ); + KeyIDList getEncryptionKeys( const TQString& person ); /** Set pass phrase */ bool setPassPhrase(const char* pass); @@ -350,21 +350,21 @@ private: void wipePassPhrase(bool free=false); // transform an address into canonical form - QString canonicalAddress( const QString& person ); + TQString canonicalAddress( const TQString& person ); /** Shows a dialog to let the user select a key from the given list of keys */ KeyID selectKey( const KeyList& keys, - const QString& title, - const QString& text = QString::null, + const TQString& title, + const TQString& text = TQString::null, const KeyID& keyId = KeyID(), const unsigned int allowedKeys = AllKeys ); /** Shows a dialog to let the user select a key from the given list of keys */ KeyIDList selectKeys( const KeyList& keys, - const QString& title, - const QString& text = QString::null, + const TQString& title, + const TQString& text = TQString::null, const KeyIDList& keyIds = KeyIDList(), const unsigned int allowedKeys = AllKeys ); @@ -374,8 +374,8 @@ private: */ KeyID selectKey( bool& rememberChoice, const KeyList& keys, - const QString& title, - const QString& text = QString::null, + const TQString& title, + const TQString& text = TQString::null, const KeyID& keyId = KeyID(), const unsigned int allowedKeys = AllKeys ); @@ -385,22 +385,22 @@ private: */ KeyIDList selectKeys( bool& rememberChoice, const KeyList& keys, - const QString& title, - const QString& text = QString::null, + const TQString& title, + const TQString& text = TQString::null, const KeyIDList& keyIds = KeyIDList(), const unsigned int allowedKeys = AllKeys ); /** Returns the OpenPGP keys which should be used for encryption to the given address. */ - KeyIDList keysForAddress( const QString& address ); + KeyIDList keysForAddress( const TQString& address ); /** Set an email address -> list of OpenPGP keys association. */ - void setKeysForAddress( const QString& address, const KeyIDList& keyIDs ); + void setKeysForAddress( const TQString& address, const KeyIDList& keyIDs ); /** Remove an email address -> OpenPGP key association. */ - void removeKeyForAddress( const QString& address ); + void removeKeyForAddress( const TQString& address ); /** Reads the email address -> OpenPGP key associations from the config file. @@ -422,7 +422,7 @@ private: KeyIDList keyIds; EncryptPref encrPref; }; - typedef QMap<QString, AddressData> AddressDataDict; + typedef TQMap<TQString, AddressData> AddressDataDict; AddressDataDict addressDataDict; KeyList mPublicKeys; @@ -434,7 +434,7 @@ private: char * passphrase; size_t passphrase_buffer_len; - QString errMsg; + TQString errMsg; KeyID pgpUser; // the key ID which is used to sign/encrypt to self bool flagEncryptToSelf : 1; diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp index 39762333d..fa444be7f 100644 --- a/libkpgp/kpgpbase.cpp +++ b/libkpgp/kpgpbase.cpp @@ -31,7 +31,7 @@ #include <sys/wait.h> /* waitpid */ #include <errno.h> -#include <qapplication.h> +#include <tqapplication.h> namespace Kpgp { @@ -50,10 +50,10 @@ Base::~Base() void Base::clear() { - input = QCString(); - output = QCString(); - error = QCString(); - errMsg = QString::null; + input = TQCString(); + output = TQCString(); + error = TQCString(); + errMsg = TQString::null; status = OK; } @@ -85,7 +85,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) close(ppass[1]); // tell pgp which fd to use for the passphrase - QCString tmp; + TQCString tmp; tmp.sprintf("%d",ppass[0]); ::setenv("PGPPASSFD",tmp.data(),1); @@ -98,7 +98,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) //Uncomment these lines for testing only! Doing so will decrease security! kdDebug(5100) << "pgp cmd = " << cmd << endl; - //kdDebug(5100) << "pgp input = " << QString(input) + //kdDebug(5100) << "pgp input = " << TQString(input) // << "input length = " << input.length() << endl; error = ""; @@ -108,7 +108,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) pipe(pout); pipe(perr); - QApplication::flushX(); + TQApplication::flushX(); if(!(child_pid = fork())) { /*We're the child.*/ @@ -362,7 +362,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) } //Uncomment these lines for testing only! Doing so will decrease security! - //kdDebug(5100) << "pgp output = " << QString(output) << endl; + //kdDebug(5100) << "pgp output = " << TQString(output) << endl; //kdDebug(5100) << "pgp error = " << error << endl; /* Make the information visible, so that a user can @@ -411,7 +411,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) //Uncomment these lines for testing only! Doing so will decrease security! //kdDebug(5100) << "pgp cmd = " << cmd << endl; - //kdDebug(5100) << "pgp input = " << QString(input) + //kdDebug(5100) << "pgp input = " << TQString(input) // << "input length = " << input.length() << endl; error = ""; @@ -448,7 +448,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) snprintf(gpgcmd, 1023, "LANGUAGE=C gpg %s",cmd); } - QApplication::flushX(); + TQApplication::flushX(); if(!(child_pid = fork())) { /*We're the child.*/ @@ -655,7 +655,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) } //Uncomment these lines for testing only! Doing so will decrease security! - //kdDebug(5100) << "gpg stdout:\n" << QString(output) << endl; + //kdDebug(5100) << "gpg stdout:\n" << TQString(output) << endl; // Make the information visible, so that a user can // get to know what's going on during the gpg calls. @@ -668,8 +668,8 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) QCString Base::addUserId() { - QCString cmd; - QCString pgpUser = Module::getKpgp()->user(); + TQCString cmd; + TQCString pgpUser = Module::getKpgp()->user(); if(!pgpUser.isEmpty()) { @@ -677,7 +677,7 @@ Base::addUserId() cmd += pgpUser; return cmd; } - return QCString(); + return TQCString(); } diff --git a/libkpgp/kpgpbase.h b/libkpgp/kpgpbase.h index f0f1d190d..aaa389eb8 100644 --- a/libkpgp/kpgpbase.h +++ b/libkpgp/kpgpbase.h @@ -19,9 +19,9 @@ #ifndef KPGPBASE_H #define KPGPBASE_H -#include <qstring.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include "kpgpkey.h" #include "kpgpblock.h" @@ -64,16 +64,16 @@ public: { return 0; } /** Returns the list of public keys in the users public keyring. */ - virtual KeyList publicKeys( const QStringList & = QStringList() ) + virtual KeyList publicKeys( const TQStringList & = TQStringList() ) { return KeyList(); } /** Returns the list of secret keys in the users secret keyring. */ - virtual KeyList secretKeys( const QStringList & = QStringList() ) + virtual KeyList secretKeys( const TQStringList & = TQStringList() ) { return KeyList(); } /** Returns the ascii armored data of the public key with the given key id. */ - virtual QCString getAsciiPublicKey(const KeyID& ) { return QCString(); } + virtual TQCString getAsciiPublicKey(const KeyID& ) { return TQCString(); } /** Signs the given key with the currently set user key. This is currently not implemented. */ @@ -82,7 +82,7 @@ public: /** Returns an error message if an error occurred during the last operation. */ - virtual QString lastErrorMessage() const; + virtual TQString lastErrorMessage() const; protected: @@ -92,14 +92,14 @@ protected: bool onlyReadFromGnuPG = false ); virtual void clear(); - QCString addUserId(); + TQCString addUserId(); - QCString input; - QCString output; - QCString error; - QString errMsg; + TQCString input; + TQCString output; + TQCString error; + TQString errMsg; - QCString mVersion; + TQCString mVersion; int status; @@ -124,19 +124,19 @@ public: virtual Key* readPublicKey( const KeyID& keyID, const bool readTrust = false, Key* key = 0 ); - virtual KeyList publicKeys( const QStringList & patterns = QStringList() ); - virtual KeyList secretKeys( const QStringList & patterns = QStringList() ); - virtual QCString getAsciiPublicKey( const KeyID& keyID ); + virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); + virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); + virtual TQCString getAsciiPublicKey( const KeyID& keyID ); virtual int signKey( const KeyID& keyID, const char *passphrase ); protected: - KeyList doGetPublicKeys( const QCString & cmd, - const QStringList & patterns ); - virtual KeyList parseKeyList( const QCString&, bool ); + KeyList doGetPublicKeys( const TQCString & cmd, + const TQStringList & patterns ); + virtual KeyList parseKeyList( const TQCString&, bool ); private: - Key* parsePublicKeyData( const QCString& output, Key* key = 0 ); - void parseTrustDataForKey( Key* key, const QCString& str ); + Key* parsePublicKeyData( const TQCString& output, Key* key = 0 ); + void parseTrustDataForKey( Key* key, const TQCString& str ); }; class BaseG : public Base @@ -156,14 +156,14 @@ public: virtual Key* readPublicKey( const KeyID& keyID, const bool readTrust = false, Key* key = 0 ); - virtual KeyList publicKeys( const QStringList & patterns = QStringList() ); - virtual KeyList secretKeys( const QStringList & patterns = QStringList() ); - virtual QCString getAsciiPublicKey( const KeyID& keyID ); + virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); + virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); + virtual TQCString getAsciiPublicKey( const KeyID& keyID ); virtual int signKey( const KeyID& keyID, const char *passphrase ); private: - Key* parseKeyData( const QCString& output, int& offset, Key* key = 0 ); - KeyList parseKeyList( const QCString&, bool ); + Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 ); + KeyList parseKeyList( const TQCString&, bool ); }; @@ -184,16 +184,16 @@ public: virtual Key* readPublicKey( const KeyID& keyID, const bool readTrust = false, Key* key = 0 ); - virtual KeyList publicKeys( const QStringList & patterns = QStringList() ); - virtual KeyList secretKeys( const QStringList & patterns = QStringList() ); - virtual QCString getAsciiPublicKey( const KeyID& keyID ); + virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); + virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); + virtual TQCString getAsciiPublicKey( const KeyID& keyID ); virtual int signKey( const KeyID& keyID, const char *passphrase ); private: - Key* parseKeyData( const QCString& output, int& offset, Key* key = 0 ); - Key* parseSingleKey( const QCString& output, Key* key = 0 ); - KeyList parseKeyList( const QCString& output, bool ); - void parseTrustDataForKey( Key* key, const QCString& str ); + Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 ); + Key* parseSingleKey( const TQCString& output, Key* key = 0 ); + KeyList parseKeyList( const TQCString& output, bool ); + void parseTrustDataForKey( Key* key, const TQCString& str ); }; @@ -210,18 +210,18 @@ public: virtual Key* readPublicKey( const KeyID& keyID, const bool readTrust = false, Key* key = 0 ); - virtual KeyList publicKeys( const QStringList & patterns = QStringList() ); - virtual KeyList secretKeys( const QStringList & patterns = QStringList() ); + virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); + virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); virtual int isVersion6(); protected: - virtual KeyList parseKeyList( const QCString &, bool ); + virtual KeyList parseKeyList( const TQCString &, bool ); private: - Key* parseKeyData( const QCString& output, int& offset, Key* key = 0 ); - Key* parseSingleKey( const QCString& output, Key* key = 0 ); - void parseTrustDataForKey( Key* key, const QCString& str ); + Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 ); + Key* parseSingleKey( const TQCString& output, Key* key = 0 ); + void parseTrustDataForKey( Key* key, const TQCString& str ); }; // --------------------------------------------------------------------------- diff --git a/libkpgp/kpgpbase2.cpp b/libkpgp/kpgpbase2.cpp index c4fd0358f..301470b76 100644 --- a/libkpgp/kpgpbase2.cpp +++ b/libkpgp/kpgpbase2.cpp @@ -26,7 +26,7 @@ #include <string.h> /* strncmp */ #include <assert.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <klocale.h> #include <kprocess.h> @@ -65,7 +65,7 @@ int Base2::encsign( Block& block, const KeyIDList& recipients, const char *passphrase ) { - QCString cmd; + TQCString cmd; int exitStatus = 0; if(!recipients.isEmpty() && passphrase != 0) @@ -117,7 +117,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients, int index = 0; bool bad = FALSE; unsigned int num = 0; - QCString badkeys = ""; + TQCString badkeys = ""; if (error.find("Cannot find the public key") != -1) { index = 0; @@ -323,7 +323,7 @@ Base2::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; @@ -421,7 +421,7 @@ Base2::decrypt( Block& block, const char *passphrase ) status |= GOODSIG; int index3 = error.find("Key ID ", index2) + 7; block.setSignatureKeyId( error.mid(index3,8) ); - block.setSignatureUserId( QString::null ); + block.setSignatureUserId( TQString::null ); } else if( (index2 = error.find("Good signature from", index)) != -1 ) { @@ -503,14 +503,14 @@ Base2::readPublicKey( const KeyID& keyID, KeyList -Base2::publicKeys( const QStringList & patterns ) +Base2::publicKeys( const TQStringList & patterns ) { return doGetPublicKeys( PGP2 " +batchmode +language=en +verbose=0 -kvc -f", patterns ); } KeyList -Base2::doGetPublicKeys( const QCString & cmd, const QStringList & patterns ) +Base2::doGetPublicKeys( const TQCString & cmd, const TQStringList & patterns ) { int exitStatus = 0; KeyList publicKeys; @@ -528,10 +528,10 @@ Base2::doGetPublicKeys( const QCString & cmd, const QStringList & patterns ) publicKeys = parseKeyList( output, false ); } else { - typedef QMap<QCString, Key*> KeyMap; + typedef TQMap<TQCString, Key*> KeyMap; KeyMap map; - for ( QStringList::ConstIterator it = patterns.begin(); + for ( TQStringList::ConstIterator it = patterns.begin(); it != patterns.end(); ++it ) { exitStatus = run( cmd + " " + KProcess::quote( *it ).local8Bit(), 0, true ); @@ -566,7 +566,7 @@ Base2::doGetPublicKeys( const QCString & cmd, const QStringList & patterns ) } KeyList -Base2::secretKeys( const QStringList & patterns ) +Base2::secretKeys( const TQStringList & patterns ) { return publicKeys( patterns ); } @@ -575,7 +575,7 @@ Base2::secretKeys( const QStringList & patterns ) int Base2::signKey(const KeyID& keyID, const char *passphrase) { - QCString cmd; + TQCString cmd; int exitStatus = 0; cmd = PGP2 " +batchmode +language=en -ks -f "; @@ -592,12 +592,12 @@ Base2::signKey(const KeyID& keyID, const char *passphrase) } -QCString Base2::getAsciiPublicKey(const KeyID& keyID) +TQCString Base2::getAsciiPublicKey(const KeyID& keyID) { int exitStatus = 0; if (keyID.isEmpty()) - return QCString(); + return TQCString(); status = 0; exitStatus = run( PGP2 " +batchmode +force +language=en -kxaf 0x" + keyID, @@ -605,7 +605,7 @@ QCString Base2::getAsciiPublicKey(const KeyID& keyID) if(exitStatus != 0) { status = ERROR; - return QCString(); + return TQCString(); } return output; @@ -613,7 +613,7 @@ QCString Base2::getAsciiPublicKey(const KeyID& keyID) Key* -Base2::parsePublicKeyData( const QCString& output, Key* key /* = 0 */ ) +Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ ) { Subkey *subkey = 0; int index; @@ -715,8 +715,8 @@ Base2::parsePublicKeyData( const QCString& output, 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 2 anyway doesn't print @@ -727,7 +727,7 @@ Base2::parsePublicKeyData( const QCString& output, Key* key /* = 0 */ ) pos = pos2 + 1; while( output[pos] == ' ' ) pos++; - QCString uid = output.mid( pos, index2-pos ); + TQCString uid = output.mid( pos, index2-pos ); if( uid != "*** KEY REVOKED ***" ) key->addUserID( uid ); else @@ -752,7 +752,7 @@ Base2::parsePublicKeyData( const QCString& output, Key* key /* = 0 */ ) // Example: // Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49 - QCString fingerprint = output.mid( pos, index2-pos ); + TQCString fingerprint = output.mid( pos, index2-pos ); // remove white space from the fingerprint for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) fingerprint.replace( idx, 1, "" ); @@ -774,8 +774,8 @@ Base2::parsePublicKeyData( const QCString& output, 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 ) ); // Here the same comments as for the creation date are valid. subkey->setExpirationDate( epoch.secsTo( dt ) ); pos += 11; // note that there is always a blank after the expire date @@ -818,12 +818,12 @@ Base2::parsePublicKeyData( const QCString& output, Key* key /* = 0 */ ) void -Base2::parseTrustDataForKey( Key* key, const QCString& str ) +Base2::parseTrustDataForKey( Key* key, const TQCString& str ) { if( ( key == 0 ) || str.isEmpty() ) return; - QCString keyID = key->primaryKeyID(); + TQCString keyID = key->primaryKeyID(); UserIDList userIDs = key->userIDs(); // search the trust data belonging to this key @@ -874,7 +874,7 @@ Base2::parseTrustDataForKey( Key* key, const QCString& str ) int pos = index + 31; if( str[index+2] == ' ' ) pos++; // additional user IDs start one column later - QString uid = str.mid( pos, index2-pos ); + TQString uid = str.mid( pos, index2-pos ); // set the validity of the corresponding user ID for( UserIDListIterator it( userIDs ); it.current(); ++it ) @@ -893,7 +893,7 @@ Base2::parseTrustDataForKey( Key* key, const QCString& str ) KeyList -Base2::parseKeyList( const QCString& output, bool secretKeys ) +Base2::parseKeyList( const TQCString& output, bool secretKeys ) { kdDebug(5100) << "Kpgp::Base2::parseKeyList()" << endl; KeyList keys; @@ -995,8 +995,8 @@ Base2::parseKeyList( const QCString& output, bool secretKeys ) 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 2 anyway doesn't print @@ -1007,7 +1007,7 @@ Base2::parseKeyList( const QCString& output, bool secretKeys ) pos = pos2 + 1; while( output[pos] == ' ' ) pos++; - QCString uid = output.mid( pos, index2-pos ); + TQCString uid = output.mid( pos, index2-pos ); if( uid != "*** KEY REVOKED ***" ) key->addUserID( uid ); else @@ -1033,7 +1033,7 @@ Base2::parseKeyList( const QCString& output, bool secretKeys ) int pos2; pos2 = pos + 18; - QCString fingerprint = output.mid( pos, index2-pos ); + TQCString fingerprint = output.mid( pos, index2-pos ); // remove white space from the fingerprint for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) fingerprint.replace( idx, 1, "" ); @@ -1055,8 +1055,8 @@ Base2::parseKeyList( const QCString& output, bool secretKeys ) 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 ) ); // Here the same comments as for the creation date are valid. subkey->setExpirationDate( epoch.secsTo( dt ) ); pos += 11; // note that there is always a blank after the expire date 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 <string.h> /* strncmp */ #include <assert.h> -#include <qregexp.h> -#include <qdatetime.h> +#include <tqregexp.h> +#include <tqdatetime.h> #include <klocale.h> #include <kprocess.h> @@ -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 ) diff --git a/libkpgp/kpgpbase6.cpp b/libkpgp/kpgpbase6.cpp index 75e47e1de..6ee6af221 100644 --- a/libkpgp/kpgpbase6.cpp +++ b/libkpgp/kpgpbase6.cpp @@ -25,7 +25,7 @@ #include <string.h> /* strncmp */ #include <assert.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <klocale.h> #include <kdebug.h> @@ -137,13 +137,13 @@ Base6::decrypt( Block& block, const char *passphrase ) kdDebug(5100) << "Message was signed on '" << block.signatureDate() << "'\n"; } else - block.setSignatureDate( QCString() ); + block.setSignatureDate( TQCString() ); // determine signature status and signature key if( error.find("signature not checked") != -1) { index = error.find("KeyID:",index); block.setSignatureKeyId( error.mid(index+9,8) ); - block.setSignatureUserId( QString::null ); + block.setSignatureUserId( TQString::null ); status |= UNKNOWN_SIG; status |= GOODSIG; } @@ -158,7 +158,7 @@ Base6::decrypt( Block& block, const char *passphrase ) // get key ID of signer index = error.find("KeyID:",index2); if (index == -1) - block.setSignatureKeyId( QCString() ); + block.setSignatureKeyId( TQCString() ); else block.setSignatureKeyId( error.mid(index+9,8) ); } @@ -175,8 +175,8 @@ Base6::decrypt( Block& block, const char *passphrase ) else { status |= ERROR; - block.setSignatureUserId( QString::null ); - block.setSignatureKeyId( QCString() ); + block.setSignatureUserId( TQString::null ); + block.setSignatureKeyId( TQCString() ); } } //kdDebug(5100) << "status = " << status << endl; @@ -226,7 +226,7 @@ Base6::readPublicKey( const KeyID& keyID, KeyList -Base6::publicKeys( const QStringList & patterns ) +Base6::publicKeys( const TQStringList & patterns ) { return doGetPublicKeys( PGP6 " +batchmode -compatible +verbose=0 " "+language=C -kvvc", patterns ); @@ -252,7 +252,7 @@ Base6::pubKeys() //truncate trailing "\n" if (error.length() > 1) error.truncate(error.length()-1); - QStrList publicKeys; + TQStrList publicKeys; index = error.find("bits/keyID",1); // skip first to "\n" if (index ==-1) { @@ -266,7 +266,7 @@ Base6::pubKeys() while( (index = error.find("\n",index)) != -1) { //parse line - QCString line; + TQCString line; if( (index2 = error.find("\n",index+1)) != -1) // skip last line { @@ -301,14 +301,14 @@ Base6::pubKeys() line = line.stripWhiteSpace(); } else { // line with new key - int index4 = error.find(QRegExp("/\\d{2}/\\d{2} "), index); + int index4 = error.find(TQRegExp("/\\d{2}/\\d{2} "), index); line = error.mid(index4+7,index2-index4-7); } //kdDebug(5100) << "Base: found key for " << (const char *)line << endl; // don't add PGP's comments to the key list if (strncmp(line.data(),"*** KEY EXPIRED ***",19) && - line.find(QRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 && + line.find(TQRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 && strncmp(line.data(),"*** DEFAULT SIGNING KEY ***",27)) { publicKeys.append(line); } @@ -328,7 +328,7 @@ Base6::pubKeys() index = 0; while ( (index = error.find("\n >", index)) != -1 ) { - QCString line; + TQCString line; index += 4; index2 = error.find(" \"", index); line = error.mid(index, index2-index+1).stripWhiteSpace(); @@ -343,7 +343,7 @@ Base6::pubKeys() KeyList -Base6::secretKeys( const QStringList & patterns ) +Base6::secretKeys( const TQStringList & patterns ) { return publicKeys( patterns ); } @@ -374,7 +374,7 @@ Base6::isVersion6() Key* -Base6::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) +Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ ) // This function parses the data for a single key which is output by PGP 6 // with the following command line arguments: // +batchmode -compatible +verbose=0 +language=C -kvvc @@ -486,8 +486,8 @@ Base6::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 6 anyway doesn't print @@ -524,7 +524,7 @@ Base6::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 ) ); // Here the same comments as for the creation date are valid. subkey->setExpirationDate( epoch.secsTo( dt ) ); pos += 10; @@ -537,7 +537,7 @@ Base6::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) } else { - QCString uid = output.mid( pos, eol-pos ); + TQCString uid = output.mid( pos, eol-pos ); key->addUserID( uid ); pos = eol; //kdDebug(5100) << "User ID:"<<uid<<endl; @@ -628,7 +628,7 @@ Base6::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) } else { - QCString uid = output.mid( pos, eol-pos ); + TQCString uid = output.mid( pos, eol-pos ); key->addUserID( uid ); pos = eol; //kdDebug(5100) << "User ID:"<<uid<<endl; @@ -660,7 +660,7 @@ Base6::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) fpr = true; // we found a fingerprint pos += 18; - 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, "" ); @@ -703,7 +703,7 @@ Base6::parseKeyData( const QCString& output, int& offset, Key* key /* = 0 */ ) Key* -Base6::parseSingleKey( const QCString& output, Key* key /* = 0 */ ) +Base6::parseSingleKey( const TQCString& output, Key* key /* = 0 */ ) { int offset; @@ -733,7 +733,7 @@ Base6::parseSingleKey( const QCString& output, Key* key /* = 0 */ ) KeyList -Base6::parseKeyList( const QCString& output, bool secretKeys ) +Base6::parseKeyList( const TQCString& output, bool secretKeys ) { kdDebug(5100) << "Kpgp::Base6::parseKeyList()" << endl; KeyList keys; @@ -773,12 +773,12 @@ Base6::parseKeyList( const QCString& output, bool secretKeys ) void -Base6::parseTrustDataForKey( Key* key, const QCString& str ) +Base6::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 @@ -820,7 +820,7 @@ Base6::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 ) 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; diff --git a/libkpgp/kpgpblock.cpp b/libkpgp/kpgpblock.cpp index 8bf551199..015929c26 100644 --- a/libkpgp/kpgpblock.cpp +++ b/libkpgp/kpgpblock.cpp @@ -23,7 +23,7 @@ namespace Kpgp { -Block::Block( const QCString& str ) +Block::Block( const TQCString& str ) : mText(str), mProcessedText(), mError(), mSignatureUserId(), mSignatureKeyId(), mSignatureDate(), mRequiredKey(), mEncryptedFor(), @@ -39,12 +39,12 @@ Block::~Block() void Block::reset() { - mProcessedText = QCString(); - mError = QCString(); - mSignatureUserId = QString::null; - mSignatureKeyId = QCString(); - mSignatureDate = QCString(); - mRequiredKey = QCString(); + mProcessedText = TQCString(); + mError = TQCString(); + mSignatureUserId = TQString::null; + mSignatureKeyId = TQCString(); + mSignatureDate = TQCString(); + mRequiredKey = TQCString(); mEncryptedFor.clear(); mStatus = 0; mHasBeenProcessed = false; @@ -54,7 +54,7 @@ void Block::clear() { reset(); - mText = QCString(); + mText = TQCString(); mType = NoPgpBlock; } @@ -111,7 +111,7 @@ Block::verify() } Kpgp::Result -Block::clearsign( const QCString& keyId, const QCString& charset ) +Block::clearsign( const TQCString& keyId, const TQCString& charset ) { Kpgp::Module *pgp = Kpgp::Module::getKpgp(); @@ -122,8 +122,8 @@ Block::clearsign( const QCString& keyId, const QCString& charset ) } Kpgp::Result -Block::encrypt( const QStringList& receivers, const QCString& keyId, - const bool sign, const QCString& charset ) +Block::encrypt( const TQStringList& receivers, const TQCString& keyId, + const bool sign, const TQCString& charset ) { Kpgp::Module *pgp = Kpgp::Module::getKpgp(); diff --git a/libkpgp/kpgpblock.h b/libkpgp/kpgpblock.h index 32978771c..2bce9c74c 100644 --- a/libkpgp/kpgpblock.h +++ b/libkpgp/kpgpblock.h @@ -19,13 +19,13 @@ #ifndef KPGPBLOCK_H #define KPGPBLOCK_H -#include <qcstring.h> -#include <qstring.h> -#include <qstrlist.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstrlist.h> #include <kdepimmacros.h> -//#include <qstringlist.h> +//#include <tqstringlist.h> class QStringList; #include "kpgp.h" @@ -94,13 +94,13 @@ class KDE_EXPORT Block { public: - Block( const QCString& str = QCString() ); + Block( const TQCString& str = TQCString() ); ~Block(); - QCString text() const; - void setText( const QCString& str ); + TQCString text() const; + void setText( const TQCString& str ); - void setProcessedText( const QCString& str ); + void setProcessedText( const TQCString& str ); int status() const; void setStatus( const int status ); @@ -118,31 +118,31 @@ class KDE_EXPORT Block /** returns the primary user id of the signer or a null string if we don't have the public key of the signer */ - QString signatureUserId() const; - void setSignatureUserId( const QString& userId ); + TQString signatureUserId() const; + void setSignatureUserId( const TQString& userId ); /** keyID of signer */ - QCString signatureKeyId() const; - void setSignatureKeyId( const QCString& keyId ); + TQCString signatureKeyId() const; + void setSignatureKeyId( const TQCString& keyId ); /** date of the signature - WARNING: Will most likely be changed to QDateTime */ - QCString signatureDate() const; - void setSignatureDate( const QCString& date ); + WARNING: Will most likely be changed to TQDateTime */ + TQCString signatureDate() const; + void setSignatureDate( const TQCString& date ); /** the persons who can decrypt the message */ - const QStrList encryptedFor() const; + const TQStrList encryptedFor() const; /** shows the secret key which is needed to decrypt the message */ - QString requiredKey() const; - void setRequiredKey( const QCString& keyId ); + TQString requiredKey() const; + void setRequiredKey( const TQCString& keyId ); - QString requiredUserId() const; - void setRequiredUserId( const QString& userId ); + TQString requiredUserId() const; + void setRequiredUserId( const TQString& userId ); - QCString error() const; - void setError( const QCString& str ); + TQCString error() const; + void setError( const TQCString& str ); /** Resets all information about this OpenPGP block */ void reset(); @@ -160,8 +160,8 @@ class KDE_EXPORT Block false if there was an unresolvable error or if signing was canceled true if everything is o.k. */ - Kpgp::Result clearsign( const QCString& keyId, - const QCString& charset = QCString() ); + Kpgp::Result clearsign( const TQCString& keyId, + const TQCString& charset = TQCString() ); /** encrypts this OpenPGP block for a list of persons. if sign is true then the message is signed with the key corresponding to the given key id. @@ -169,23 +169,23 @@ class KDE_EXPORT Block false if there was an unresolvable error or if encryption was canceled true if everything is o.k. */ - Kpgp::Result encrypt( const QStringList& receivers, const QCString& keyId, - const bool sign, const QCString& charset = QCString() ); + Kpgp::Result encrypt( const TQStringList& receivers, const TQCString& keyId, + const bool sign, const TQCString& charset = TQCString() ); private: void clear(); BlockType determineType() const; - QCString mText; - QCString mProcessedText; - QCString mError; - QString mSignatureUserId; - QCString mSignatureKeyId; - QCString mSignatureDate; - QCString mRequiredKey; - QString mRequiredUserId; - QStrList mEncryptedFor; + TQCString mText; + TQCString mProcessedText; + TQCString mError; + TQString mSignatureUserId; + TQCString mSignatureKeyId; + TQCString mSignatureDate; + TQCString mRequiredKey; + TQString mRequiredUserId; + TQStrList mEncryptedFor; int mStatus; bool mHasBeenProcessed; BlockType mType; @@ -203,14 +203,14 @@ Block::text() const } inline void -Block::setText( const QCString& str ) +Block::setText( const TQCString& str ) { clear(); mText = str; } inline void -Block::setProcessedText( const QCString& str ) +Block::setProcessedText( const TQCString& str ) { mProcessedText = str; mHasBeenProcessed = true; @@ -223,7 +223,7 @@ Block::error() const } inline void -Block::setError( const QCString& str ) +Block::setError( const TQCString& str ) { mError = str; } @@ -255,7 +255,7 @@ Block::signatureUserId() const } inline void -Block::setSignatureUserId( const QString& userId ) +Block::setSignatureUserId( const TQString& userId ) { mSignatureUserId = userId; } @@ -267,7 +267,7 @@ Block::signatureKeyId() const } inline void -Block::setSignatureKeyId( const QCString& keyId ) +Block::setSignatureKeyId( const TQCString& keyId ) { mSignatureKeyId = keyId; } @@ -279,7 +279,7 @@ Block::signatureDate() const } inline void -Block::setSignatureDate( const QCString& date ) +Block::setSignatureDate( const TQCString& date ) { mSignatureDate = date; } @@ -291,7 +291,7 @@ Block::requiredKey() const } inline void -Block::setRequiredKey( const QCString& keyId ) +Block::setRequiredKey( const TQCString& keyId ) { mRequiredKey = keyId; } @@ -303,7 +303,7 @@ Block::requiredUserId() const } inline void -Block::setRequiredUserId( const QString& userId ) +Block::setRequiredUserId( const TQString& userId ) { mRequiredUserId = userId; } diff --git a/libkpgp/kpgpkey.cpp b/libkpgp/kpgpkey.cpp index d0d2e4ec3..8a8ed48b8 100644 --- a/libkpgp/kpgpkey.cpp +++ b/libkpgp/kpgpkey.cpp @@ -23,23 +23,23 @@ namespace Kpgp { /* member functions of Kpgp::KeyIDList --------------------------------- */ -/** Converts from a KeyIDList to a QStringList. +/** Converts from a KeyIDList to a TQStringList. */ -QStringList KeyIDList::toStringList() const +TQStringList KeyIDList::toStringList() const { - QStringList res; + TQStringList res; for( KeyIDList::ConstIterator it = begin(); it != end(); ++it ) { res << (*it).data(); } return res; } -/** Converts from a QStringList to a KeyIDList. +/** Converts from a TQStringList to a KeyIDList. */ -KeyIDList KeyIDList::fromStringList( const QStringList& l ) +KeyIDList KeyIDList::fromStringList( const TQStringList& l ) { KeyIDList res; - for( QStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { + for( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { res << (*it).local8Bit(); } return res; @@ -47,7 +47,7 @@ KeyIDList KeyIDList::fromStringList( const QStringList& l ) /* member functions of Kpgp::UserID ------------------------------------ */ -UserID::UserID(const QString& str, const Validity validity, +UserID::UserID(const TQString& str, const Validity validity, const bool revoked, const bool invalid) { mText = str; @@ -81,7 +81,7 @@ Subkey::Subkey(const KeyID& keyID, const bool secret) /* member functions of Kpgp::Key --------------------------------------- */ -Key::Key(const KeyID& keyid, const QString& uid, const bool secret) : +Key::Key(const KeyID& keyid, const TQString& uid, const bool secret) : mSubkeys(), mUserIDs() { mSecret = secret; @@ -145,7 +145,7 @@ Key::keyTrust() const } Validity -Key::keyTrust( const QString& uid ) const +Key::keyTrust( const TQString& uid ) const { Validity trust = KPGP_VALIDITY_UNKNOWN; @@ -194,7 +194,7 @@ Key::isValidSigningKey() const } -void Key::addUserID(const QString &uid, const Validity validity, +void Key::addUserID(const TQString &uid, const Validity validity, const bool revoked, const bool invalid) { if (!uid.isEmpty()) { @@ -203,7 +203,7 @@ void Key::addUserID(const QString &uid, const Validity validity, } } -bool Key::matchesUserID(const QString& str, bool cs) +bool Key::matchesUserID(const TQString& str, bool cs) { if (str.isEmpty() || mUserIDs.isEmpty()) return false; @@ -246,7 +246,7 @@ Subkey *Key::getSubkey(const KeyID& keyID) return 0; } -void Key::setFingerprint(const KeyID& keyID, const QCString &fpr) +void Key::setFingerprint(const KeyID& keyID, const TQCString &fpr) { Subkey *key; if ((key = getSubkey(keyID)) != 0) { diff --git a/libkpgp/kpgpkey.h b/libkpgp/kpgpkey.h index fd92f5a1e..a0cf9b624 100644 --- a/libkpgp/kpgpkey.h +++ b/libkpgp/kpgpkey.h @@ -21,10 +21,10 @@ #include <time.h> -#include <qcstring.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> namespace Kpgp { @@ -54,19 +54,19 @@ typedef enum } EncryptPref; -typedef QCString KeyID; +typedef TQCString KeyID; -class KeyIDList : public QValueList<KeyID> +class KeyIDList : public TQValueList<KeyID> { public: KeyIDList() { } - KeyIDList( const KeyIDList& l ) : QValueList<KeyID>(l) { } - KeyIDList( const QValueList<KeyID>& l ) : QValueList<KeyID>(l) { } + KeyIDList( const KeyIDList& l ) : TQValueList<KeyID>(l) { } + KeyIDList( const TQValueList<KeyID>& l ) : TQValueList<KeyID>(l) { } KeyIDList( const KeyID& i ) { append(i); } - QStringList toStringList() const; + TQStringList toStringList() const; - static KeyIDList fromStringList( const QStringList& ); + static KeyIDList fromStringList( const TQStringList& ); }; /** This class is used to store information about a user id of a PGP key. @@ -75,14 +75,14 @@ class UserID { public: /** Constructs a new user id with the given values. */ - UserID(const QString& str, + UserID(const TQString& str, const Validity validity = KPGP_VALIDITY_UNKNOWN, const bool revoked = false, const bool invalid = false); ~UserID() {}; /** Returns the text of the user id. */ - QString text() const; + TQString text() const; /** Returns true if the user id has been revoked. */ bool revoked() const; @@ -94,7 +94,7 @@ class UserID Validity validity() const; /** Sets the text of the user id to <em>str</em>. */ - void setText(const QString& str); + void setText(const TQString& str); /** Sets the flag if the user id has been revoked to <em>revoked</em>. */ void setRevoked(const bool revoked); @@ -110,13 +110,13 @@ class UserID bool mRevoked : 1; bool mInvalid : 1; Validity mValidity; - QString mText; + TQString mText; }; -typedef QPtrList<UserID> UserIDList; -typedef QPtrListIterator<UserID> UserIDListIterator; +typedef TQPtrList<UserID> UserIDList; +typedef TQPtrListIterator<UserID> UserIDListIterator; -inline QString UserID::text() const +inline TQString UserID::text() const { return mText; } @@ -136,7 +136,7 @@ inline Validity UserID::validity() const return mValidity; } -inline void UserID::setText(const QString& str) +inline void UserID::setText(const TQString& str) { mText = str; } @@ -204,7 +204,7 @@ class Subkey KeyID keyID() const; /** Returns the fingerprint of the subkey. */ - QCString fingerprint() const; + TQCString fingerprint() const; /** Returns the creation date of the subkey. */ time_t creationDate() const; @@ -249,7 +249,7 @@ class Subkey void setKeyID(const KeyID& keyID); /** Sets the fingerprint of the subkey to <em>fingerprint</em>. */ - void setFingerprint(const QCString& fingerprint); + void setFingerprint(const TQCString& fingerprint); /** Sets the creation date of the subkey to <em>creationDate</em> seconds since Epoch. */ @@ -273,7 +273,7 @@ class Subkey unsigned int mKeyAlgo; unsigned int mKeyLen; KeyID mKeyID; - QCString mFingerprint; + TQCString mFingerprint; time_t mTimestamp; /* -1 for invalid, 0 for not available */ time_t mExpiration; /* -1 for never, 0 for not available */ }; @@ -338,7 +338,7 @@ inline KeyID Subkey::keyID() const return mKeyID.right(8); } -inline QCString Subkey::fingerprint() const +inline TQCString Subkey::fingerprint() const { return mFingerprint; } @@ -408,7 +408,7 @@ inline void Subkey::setKeyID(const KeyID& keyID) mKeyID = keyID; } -inline void Subkey::setFingerprint(const QCString& fingerprint) +inline void Subkey::setFingerprint(const TQCString& fingerprint) { mFingerprint = fingerprint; } @@ -423,8 +423,8 @@ inline void Subkey::setExpirationDate(const time_t expirationDate) mExpiration = expirationDate; } -typedef QPtrList<Subkey> SubkeyList; -typedef QPtrListIterator<Subkey> SubkeyListIterator; +typedef TQPtrList<Subkey> SubkeyList; +typedef TQPtrListIterator<Subkey> SubkeyListIterator; /** This class is used to store information about a PGP key. @@ -435,7 +435,7 @@ class Key /** Constructs a new PGP key with <em>keyid</em> as key ID of the primary key and <em>uid</em> as primary user ID. */ Key( const KeyID& keyid = KeyID(), - const QString& uid = QString::null, + const TQString& uid = TQString::null, const bool secret = false); ~Key(); @@ -503,7 +503,7 @@ class Key /** Returns the primary user ID or a null string if there are no user IDs. */ - QString primaryUserID() const; + TQString primaryUserID() const; /** Returns the key ID of the primary key or a null string if there are no subkeys. */ @@ -511,7 +511,7 @@ class Key /** Returns the fingerprint of the primary key or a null string if there are no subkeys. */ - QCString primaryFingerprint() const; + TQCString primaryFingerprint() const; /** Returns true if there are no user IDs or no subkeys.*/ bool isNull() const; @@ -527,7 +527,7 @@ class Key /** Returns the trust value for the given user id of this key. */ - Validity keyTrust( const QString& uid ) const; + Validity keyTrust( const TQString& uid ) const; /** Set the validity values for the user ids to the validity values of the given key. This is useful after rereading a key without expensive @@ -557,7 +557,7 @@ class Key /** Adds a user ID with the given values to the key if <em>uid</em> isn't an empty string. */ - void addUserID(const QString& uid, + void addUserID(const TQString& uid, const Validity validity = KPGP_VALIDITY_UNKNOWN, const bool revoked = false, const bool invalid = false); @@ -568,7 +568,7 @@ class Key /** Returns true if the given string matches one of the user IDs. The match is case sensitive if <em>cs</em> is true or case insensitive if <em>cs</em> is false. */ - bool matchesUserID(const QString& str, bool cs = true); + bool matchesUserID(const TQString& str, bool cs = true); /** Adds a subkey with the given values to the key if <em>keyID</em> isn't an empty string. */ @@ -581,7 +581,7 @@ class Key Subkey *getSubkey(const KeyID& keyID); /** Sets the fingerprint of the given subkey to <em>fpr</em>. */ - void setFingerprint(const KeyID& keyID, const QCString& fpr); + void setFingerprint(const KeyID& keyID, const TQCString& fpr); protected: bool mSecret : 1; @@ -690,14 +690,14 @@ inline void Key::setEncryptionPreference( const EncryptPref encrPref ) mEncryptPref = encrPref; } -inline QString Key::primaryUserID() const +inline TQString Key::primaryUserID() const { UserID *uid = mUserIDs.getFirst(); if (uid) return uid->text(); else - return QString::null; + return TQString::null; } inline KeyID Key::primaryKeyID() const @@ -710,14 +710,14 @@ inline KeyID Key::primaryKeyID() const return KeyID(); } -inline QCString Key::primaryFingerprint() const +inline TQCString Key::primaryFingerprint() const { Subkey *key = mSubkeys.getFirst(); if (key) return key->fingerprint(); else - return QCString(); + return TQCString(); } inline const UserIDList Key::userIDs() const @@ -757,8 +757,8 @@ inline void Key::addSubkey(const Subkey *subkey) -typedef QPtrList<Key> KeyListBase; -typedef QPtrListIterator<Key> KeyListIterator; +typedef TQPtrList<Key> KeyListBase; +typedef TQPtrListIterator<Key> KeyListIterator; class KeyList : public KeyListBase { @@ -767,10 +767,10 @@ class KeyList : public KeyListBase { clear(); } private: - int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) + int compareItems( TQPtrCollection::Item s1, TQPtrCollection::Item s2 ) { // sort case insensitively by the primary User IDs - return QString::compare((static_cast<Key*>(s1))->primaryUserID().lower(), + return TQString::compare((static_cast<Key*>(s1))->primaryUserID().lower(), (static_cast<Key*>(s2))->primaryUserID().lower()); } }; diff --git a/libkpgp/kpgpui.cpp b/libkpgp/kpgpui.cpp index 7483bb0c9..e0d5bee27 100644 --- a/libkpgp/kpgpui.cpp +++ b/libkpgp/kpgpui.cpp @@ -18,19 +18,19 @@ //#include <stdio.h> -#include <qvgroupbox.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qwhatsthis.h> -#include <qtooltip.h> -#include <qapplication.h> -#include <qtextcodec.h> -#include <qdatetime.h> -#include <qpixmap.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qpopupmenu.h> -#include <qregexp.h> +#include <tqvgroupbox.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> +#include <tqtooltip.h> +#include <tqapplication.h> +#include <tqtextcodec.h> +#include <tqdatetime.h> +#include <tqpixmap.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> #include <klocale.h> #include <kpassdlg.h> @@ -58,31 +58,31 @@ const int Kpgp::KeySelectionDialog::sCheckSelectionDelay = 250; namespace Kpgp { -PassphraseDialog::PassphraseDialog( QWidget *parent, - const QString &caption, bool modal, - const QString &keyID ) +PassphraseDialog::PassphraseDialog( TQWidget *parent, + const TQString &caption, bool modal, + const TQString &keyID ) :KDialogBase( parent, 0, modal, caption, Ok|Cancel ) { - QHBox *hbox = makeHBoxMainWidget(); + TQHBox *hbox = makeHBoxMainWidget(); hbox->setSpacing( spacingHint() ); hbox->setMargin( marginHint() ); - QLabel *label = new QLabel(hbox); + TQLabel *label = new TQLabel(hbox); label->setPixmap( BarIcon("pgp-keys") ); - QWidget *rightArea = new QWidget( hbox ); - QVBoxLayout *vlay = new QVBoxLayout( rightArea, 0, spacingHint() ); + TQWidget *rightArea = new TQWidget( hbox ); + TQVBoxLayout *vlay = new TQVBoxLayout( rightArea, 0, spacingHint() ); if (keyID.isNull()) - label = new QLabel(i18n("Please enter your OpenPGP passphrase:"),rightArea); + label = new TQLabel(i18n("Please enter your OpenPGP passphrase:"),rightArea); else - label = new QLabel(i18n("Please enter the OpenPGP passphrase for\n\"%1\":").arg(keyID), + label = new TQLabel(i18n("Please enter the OpenPGP passphrase for\n\"%1\":").arg(keyID), rightArea); lineedit = new KPasswordEdit( rightArea ); - lineedit->setEchoMode(QLineEdit::Password); + lineedit->setEchoMode(TQLineEdit::Password); lineedit->setMinimumWidth( fontMetrics().maxWidth()*20 ); lineedit->setFocus(); - connect( lineedit, SIGNAL(returnPressed()), this, SLOT(slotOk()) ); + connect( lineedit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotOk()) ); vlay->addWidget( label ); vlay->addWidget( lineedit ); @@ -104,40 +104,40 @@ const char * PassphraseDialog::passphrase() // ------------------------------------------------------------------------ // Forbidden accels for KMail: AC GH OP // for KNode: ACE H O -Config::Config( QWidget *parent, const char *name, bool encrypt ) - : QWidget( parent, name ), pgp( Module::getKpgp() ) +Config::Config( TQWidget *parent, const char *name, bool encrypt ) + : TQWidget( parent, name ), pgp( Module::getKpgp() ) { - QGroupBox * group; - QLabel * label; - QString msg; + TQGroupBox * group; + TQLabel * label; + TQString msg; - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - group = new QVGroupBox( i18n("Warning"), this ); + group = new TQVGroupBox( i18n("Warning"), this ); group->layout()->setSpacing( KDialog::spacingHint() ); // (mmutz) work around Qt label bug in 3.0.0 (and possibly later): // 1. Don't use rich text: No <qt><b>...</b></qt> - label = new QLabel( i18n("Please check if encryption really " + label = new TQLabel( i18n("Please check if encryption really " "works before you start using it seriously. Also note that attachments " "are not encrypted by the PGP/GPG module."), group ); // 2. instead, set the font to bold: - QFont labelFont = label->font(); + TQFont labelFont = label->font(); labelFont.setBold( true ); label->setFont( labelFont ); // 3. and activate wordwarp: label->setAlignment( AlignLeft|WordBreak ); // end; to remove the workaround, add <qt><b>..</b></qt> around the - // text and remove lines QFont... -> label->setAlignment(...). + // text and remove lines TQFont... -> label->setAlignment(...). topLayout->addWidget( group ); - group = new QVGroupBox( i18n("Encryption Tool"), this ); + group = new TQVGroupBox( i18n("Encryption Tool"), this ); group->layout()->setSpacing( KDialog::spacingHint() ); - QHBox * hbox = new QHBox( group ); - label = new QLabel( i18n("Select encryption tool to &use:"), hbox ); - toolCombo = new QComboBox( false, hbox ); - toolCombo->insertStringList( QStringList() + TQHBox * hbox = new TQHBox( group ); + label = new TQLabel( i18n("Select encryption tool to &use:"), hbox ); + toolCombo = new TQComboBox( false, hbox ); + toolCombo->insertStringList( TQStringList() << i18n("Autodetect") << i18n("GnuPG - Gnu Privacy Guard") << i18n("PGP Version 2.x") @@ -146,18 +146,18 @@ Config::Config( QWidget *parent, const char *name, bool encrypt ) << i18n("Do not use any encryption tool") ); label->setBuddy( toolCombo ); hbox->setStretchFactor( toolCombo, 1 ); - connect( toolCombo, SIGNAL( activated( int ) ), - this, SIGNAL( changed( void ) ) ); + connect( toolCombo, TQT_SIGNAL( activated( int ) ), + this, TQT_SIGNAL( changed( void ) ) ); // This is the place to add a KURLRequester to be used for asking // the user for the path to the executable... topLayout->addWidget( group ); - mpOptionsGroupBox = new QVGroupBox( i18n("Options"), this ); + mpOptionsGroupBox = new TQVGroupBox( i18n("Options"), this ); mpOptionsGroupBox->layout()->setSpacing( KDialog::spacingHint() ); - storePass = new QCheckBox( i18n("&Keep passphrase in memory"), + storePass = new TQCheckBox( i18n("&Keep passphrase in memory"), mpOptionsGroupBox ); - connect( storePass, SIGNAL( toggled( bool ) ), - this, SIGNAL( changed( void ) ) ); + connect( storePass, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SIGNAL( changed( void ) ) ); msg = i18n( "<qt><p>When this option is enabled, the passphrase of your " "private key will be remembered by the application as long " "as the application is running. Thus you will only have to " @@ -169,46 +169,46 @@ Config::Config( QWidget *parent, const char *name, bool encrypt ) "<p>Note that when using KMail, this setting only applies " "if you are not using gpg-agent. It is also ignored " "if you are using crypto plugins.</p></qt>" ); - QWhatsThis::add( storePass, msg ); + TQWhatsThis::add( storePass, msg ); if( encrypt ) { - encToSelf = new QCheckBox( i18n("Always encr&ypt to self"), + encToSelf = new TQCheckBox( i18n("Always encr&ypt to self"), mpOptionsGroupBox ); - connect( encToSelf, SIGNAL( toggled( bool ) ), - this, SIGNAL( changed( void ) ) ); + connect( encToSelf, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SIGNAL( changed( void ) ) ); msg = i18n( "<qt><p>When this option is enabled, the message/file " "will not only be encrypted with the receiver's public key, " "but also with your key. This will enable you to decrypt the " "message/file at a later time. This is generally a good idea." "</p></qt>" ); - QWhatsThis::add( encToSelf, msg ); + TQWhatsThis::add( encToSelf, msg ); } else encToSelf = 0; - showCipherText = new QCheckBox( i18n("&Show signed/encrypted text after " + showCipherText = new TQCheckBox( i18n("&Show signed/encrypted text after " "composing"), mpOptionsGroupBox ); - connect( showCipherText, SIGNAL( toggled( bool ) ), - this, SIGNAL( changed( void ) ) ); + connect( showCipherText, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SIGNAL( changed( void ) ) ); msg = i18n( "<qt><p>When this option is enabled, the signed/encrypted text " "will be shown in a separate window, enabling you to know how " "it will look before it is sent. This is a good idea when " "you are verifying that your encryption system works.</p></qt>" ); - QWhatsThis::add( showCipherText, msg ); + TQWhatsThis::add( showCipherText, msg ); if( encrypt ) { - showKeyApprovalDlg = new QCheckBox( i18n("Always show the encryption " + showKeyApprovalDlg = new TQCheckBox( i18n("Always show the encryption " "keys &for approval"), mpOptionsGroupBox ); - connect( showKeyApprovalDlg, SIGNAL( toggled( bool ) ), - this, SIGNAL( changed( void ) ) ); + connect( showKeyApprovalDlg, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SIGNAL( changed( void ) ) ); msg = i18n( "<qt><p>When this option is enabled, the application will " "always show you a list of public keys from which you can " "choose the one it will use for encryption. If it is off, " "the application will only show the dialog if it cannot find " "the right key or if there are several which could be used. " "</p></qt>" ); - QWhatsThis::add( showKeyApprovalDlg, msg ); + TQWhatsThis::add( showKeyApprovalDlg, msg ); } else showKeyApprovalDlg = 0; @@ -280,13 +280,13 @@ Config::applySettings() // ------------------------------------------------------------------------ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList, - const QString& title, - const QString& text, + const TQString& title, + const TQString& text, const KeyIDList& keyIds, const bool rememberChoice, const unsigned int allowedKeys, const bool extendedSelection, - QWidget *parent, const char *name, + TQWidget *parent, const char *name, bool modal ) : KDialogBase( parent, name, modal, title, Default|Ok|Cancel, Ok ), mRememberCB( 0 ), @@ -299,58 +299,58 @@ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList, KConfig *config = pgp->getConfig(); KConfigGroup dialogConfig( config, "Key Selection Dialog" ); - QSize defaultSize( 580, 400 ); - QSize dialogSize = dialogConfig.readSizeEntry( "Dialog size", &defaultSize ); + TQSize defaultSize( 580, 400 ); + TQSize dialogSize = dialogConfig.readSizeEntry( "Dialog size", &defaultSize ); resize( dialogSize ); - mCheckSelectionTimer = new QTimer( this, "mCheckSelectionTimer" ); - mStartSearchTimer = new QTimer( this, "mStartSearchTimer" ); + mCheckSelectionTimer = new TQTimer( this, "mCheckSelectionTimer" ); + mStartSearchTimer = new TQTimer( this, "mStartSearchTimer" ); // load the key status icons - mKeyGoodPix = new QPixmap( UserIcon("key_ok") ); - mKeyBadPix = new QPixmap( UserIcon("key_bad") ); - mKeyUnknownPix = new QPixmap( UserIcon("key_unknown") ); - mKeyValidPix = new QPixmap( UserIcon("key") ); + mKeyGoodPix = new TQPixmap( UserIcon("key_ok") ); + mKeyBadPix = new TQPixmap( UserIcon("key_bad") ); + mKeyUnknownPix = new TQPixmap( UserIcon("key_unknown") ); + mKeyValidPix = new TQPixmap( UserIcon("key") ); - QFrame *page = makeMainWidget(); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQFrame *page = makeMainWidget(); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); if( !text.isEmpty() ) { - QLabel *label = new QLabel( page ); + TQLabel *label = new TQLabel( page ); label->setText( text ); topLayout->addWidget( label ); } - QHBoxLayout * hlay = new QHBoxLayout( topLayout ); // inherits spacing - QLineEdit * le = new QLineEdit( page ); - hlay->addWidget( new QLabel( le, i18n("&Search for:"), page ) ); + TQHBoxLayout * hlay = new TQHBoxLayout( topLayout ); // inherits spacing + TQLineEdit * le = new TQLineEdit( page ); + hlay->addWidget( new TQLabel( le, i18n("&Search for:"), page ) ); hlay->addWidget( le, 1 ); le->setFocus(); - connect( le, SIGNAL(textChanged(const QString&)), - this, SLOT(slotSearch(const QString&)) ); - connect( mStartSearchTimer, SIGNAL(timeout()), SLOT(slotFilter()) ); + connect( le, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotSearch(const TQString&)) ); + connect( mStartSearchTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotFilter()) ); mListView = new KListView( page ); mListView->addColumn( i18n("Key ID") ); mListView->addColumn( i18n("User ID") ); mListView->setAllColumnsShowFocus( true ); - mListView->setResizeMode( QListView::LastColumn ); + mListView->setResizeMode( TQListView::LastColumn ); mListView->setRootIsDecorated( true ); mListView->setShowSortIndicator( true ); mListView->setSorting( 1, true ); // sort by User ID mListView->setShowToolTips( true ); if( extendedSelection ) { - mListView->setSelectionMode( QListView::Extended ); - //mListView->setSelectionMode( QListView::Multi ); + mListView->setSelectionMode( TQListView::Extended ); + //mListView->setSelectionMode( TQListView::Multi ); } topLayout->addWidget( mListView, 10 ); if (rememberChoice) { - mRememberCB = new QCheckBox( i18n("Remember choice"), page ); + mRememberCB = new TQCheckBox( i18n("Remember choice"), page ); topLayout->addWidget( mRememberCB ); - QWhatsThis::add(mRememberCB, + TQWhatsThis::add(mRememberCB, i18n("<qt><p>If you check this box your choice will " "be stored and you will not be asked again." "</p></qt>")); @@ -358,7 +358,7 @@ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList, initKeylist( keyList, keyIds ); - QListViewItem *lvi; + TQListViewItem *lvi; if( extendedSelection ) { lvi = mListView->currentItem(); slotCheckSelection(); @@ -373,24 +373,24 @@ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList, mListView->center( mListView->contentsX(), mListView->itemPos( lvi ) ); if( extendedSelection ) { - connect( mCheckSelectionTimer, SIGNAL( timeout() ), - this, SLOT( slotCheckSelection() ) ); - connect( mListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + connect( mCheckSelectionTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotCheckSelection() ) ); + connect( mListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); } else { - connect( mListView, SIGNAL( selectionChanged( QListViewItem* ) ), - this, SLOT( slotSelectionChanged( QListViewItem* ) ) ); + connect( mListView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + this, TQT_SLOT( slotSelectionChanged( TQListViewItem* ) ) ); } - connect( mListView, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), this, SLOT( accept() ) ); + connect( mListView, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), this, TQT_SLOT( accept() ) ); - connect( mListView, SIGNAL( contextMenuRequested( QListViewItem*, - const QPoint&, int ) ), - this, SLOT( slotRMB( QListViewItem*, const QPoint&, int ) ) ); + connect( mListView, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, + const TQPoint&, int ) ), + this, TQT_SLOT( slotRMB( TQListViewItem*, const TQPoint&, int ) ) ); setButtonText( KDialogBase::Default, i18n("&Reread Keys") ); - connect( this, SIGNAL( defaultClicked() ), - this, SLOT( slotRereadKeys() ) ); + connect( this, TQT_SIGNAL( defaultClicked() ), + this, TQT_SLOT( slotRereadKeys() ) ); } @@ -420,7 +420,7 @@ KeyID KeySelectionDialog::key() const void KeySelectionDialog::initKeylist( const KeyList& keyList, const KeyIDList& keyIds ) { - QListViewItem* firstSelectedItem = 0; + TQListViewItem* firstSelectedItem = 0; mKeyIds.clear(); mListView->clear(); @@ -428,7 +428,7 @@ void KeySelectionDialog::initKeylist( const KeyList& keyList, for( KeyListIterator it( keyList ); it.current(); ++it ) { KeyID curKeyId = (*it)->primaryKeyID(); - QListViewItem* primaryUserID = new QListViewItem( mListView, curKeyId, + TQListViewItem* primaryUserID = new TQListViewItem( mListView, curKeyId, (*it)->primaryUserID() ); // select and open the given key @@ -457,16 +457,16 @@ void KeySelectionDialog::initKeylist( const KeyList& keyList, break; } - QListViewItem* childItem; + TQListViewItem* childItem; - childItem = new QListViewItem( primaryUserID, "", + childItem = new TQListViewItem( primaryUserID, "", i18n( "Fingerprint: %1" ) .arg( beautifyFingerprint( (*it)->primaryFingerprint() ) ) ); if( primaryUserID->isSelected() && mListView->isMultiSelection() ) { mListView->setSelected( childItem, true ); } - childItem = new QListViewItem( primaryUserID, "", keyInfo( *it ) ); + childItem = new TQListViewItem( primaryUserID, "", keyInfo( *it ) ); if( primaryUserID->isSelected() && mListView->isMultiSelection() ) { mListView->setSelected( childItem, true ); } @@ -476,7 +476,7 @@ void KeySelectionDialog::initKeylist( const KeyList& keyList, if( *uidit ) { ++uidit; // skip the primary user ID for( ; *uidit; ++uidit ) { - childItem = new QListViewItem( primaryUserID, "", (*uidit)->text() ); + childItem = new TQListViewItem( primaryUserID, "", (*uidit)->text() ); if( primaryUserID->isSelected() && mListView->isMultiSelection() ) { mListView->setSelected( childItem, true ); } @@ -490,9 +490,9 @@ void KeySelectionDialog::initKeylist( const KeyList& keyList, } -QString KeySelectionDialog::keyInfo( const Kpgp::Key *key ) const +TQString KeySelectionDialog::keyInfo( const Kpgp::Key *key ) const { - QString status, remark; + TQString status, remark; if( key->revoked() ) { status = i18n("Revoked"); } @@ -538,7 +538,7 @@ QString KeySelectionDialog::keyInfo( const Kpgp::Key *key ) const } } - QDateTime dt; + TQDateTime dt; dt.setTime_t( key->creationDate() ); if( remark.isEmpty() ) { return " " + i18n("creation date and status of an OpenPGP key", @@ -555,9 +555,9 @@ QString KeySelectionDialog::keyInfo( const Kpgp::Key *key ) const } } -QString KeySelectionDialog::beautifyFingerprint( const QCString& fpr ) const +TQString KeySelectionDialog::beautifyFingerprint( const TQCString& fpr ) const { - QCString result; + TQCString result; if( 40 == fpr.length() ) { // convert to this format: @@ -664,7 +664,7 @@ int KeySelectionDialog::keyValidity( const Kpgp::Key *key ) const void KeySelectionDialog::updateKeyInfo( const Kpgp::Key* key, - QListViewItem* lvi ) const + TQListViewItem* lvi ) const { if( 0 == lvi ) { return; @@ -716,7 +716,7 @@ void KeySelectionDialog::updateKeyInfo( const Kpgp::Key* key, int -KeySelectionDialog::keyAdmissibility( QListViewItem* lvi, +KeySelectionDialog::keyAdmissibility( TQListViewItem* lvi, TrustCheckMode trustCheckMode ) const { // Return: @@ -783,7 +783,7 @@ KeySelectionDialog::keyAdmissibility( QListViewItem* lvi, KeyID -KeySelectionDialog::getKeyId( const QListViewItem* lvi ) const +KeySelectionDialog::getKeyId( const TQListViewItem* lvi ) const { KeyID keyId; @@ -823,25 +823,25 @@ void KeySelectionDialog::slotRereadKeys() int offsetY = mListView->contentsY(); if( mListView->isMultiSelection() ) { - disconnect( mListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + disconnect( mListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); } else { - disconnect( mListView, SIGNAL( selectionChanged( QListViewItem * ) ), - this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); + disconnect( mListView, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + this, TQT_SLOT( slotSelectionChanged( TQListViewItem * ) ) ); } initKeylist( keys, KeyIDList( mKeyIds ) ); slotFilter(); if( mListView->isMultiSelection() ) { - connect( mListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + connect( mListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); slotSelectionChanged(); } else { - connect( mListView, SIGNAL( selectionChanged( QListViewItem * ) ), - this, SLOT( slotSelectionChanged( QListViewItem * ) ) ); + connect( mListView, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + this, TQT_SLOT( slotSelectionChanged( TQListViewItem * ) ) ); } // restore the saved position of the contents @@ -849,7 +849,7 @@ void KeySelectionDialog::slotRereadKeys() } -void KeySelectionDialog::slotSelectionChanged( QListViewItem * lvi ) +void KeySelectionDialog::slotSelectionChanged( TQListViewItem * lvi ) { slotCheckSelection( lvi ); } @@ -866,7 +866,7 @@ void KeySelectionDialog::slotSelectionChanged() } -void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) +void KeySelectionDialog::slotCheckSelection( TQListViewItem* plvi /* = 0 */ ) { kdDebug(5100) << "KeySelectionDialog::slotCheckSelection()\n"; @@ -886,16 +886,16 @@ void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) // As we might change the selection, we have to disconnect the slot // to prevent recursion - disconnect( mListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + disconnect( mListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); KeyIDList newKeyIdList; - QValueList<QListViewItem*> keysToBeChecked; + TQValueList<TQListViewItem*> keysToBeChecked; bool keysAllowed = true; enum { UNKNOWN, SELECTED, DESELECTED } userAction = UNKNOWN; // Iterate over the tree to find selected keys. - for( QListViewItem *lvi = mListView->firstChild(); + for( TQListViewItem *lvi = mListView->firstChild(); 0 != lvi; lvi = lvi->nextSibling() ) { // We make sure that either all items belonging to a key are selected @@ -906,7 +906,7 @@ void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) // First count the selected items of this key int itemCount = 1 + lvi->childCount(); int selectedCount = lvi->isSelected() ? 1 : 0; - for( QListViewItem *clvi = lvi->firstChild(); + for( TQListViewItem *clvi = lvi->firstChild(); 0 != clvi; clvi = clvi->nextSibling() ) { if( clvi->isSelected() ) { @@ -955,7 +955,7 @@ void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) if( userAction == SELECTED ) { // select all items of this key mListView->setSelected( lvi, true ); - for( QListViewItem *clvi = lvi->firstChild(); + for( TQListViewItem *clvi = lvi->firstChild(); 0 != clvi; clvi = clvi->nextSibling() ) { mListView->setSelected( clvi, true ); @@ -974,7 +974,7 @@ void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) else { // userAction == DESELECTED // deselect all items of this key mListView->setSelected( lvi, false ); - for( QListViewItem *clvi = lvi->firstChild(); + for( TQListViewItem *clvi = lvi->firstChild(); 0 != clvi; clvi = clvi->nextSibling() ) { mListView->setSelected( clvi, false ); @@ -989,13 +989,13 @@ void KeySelectionDialog::slotCheckSelection( QListViewItem* plvi /* = 0 */ ) } enableButtonOK( keysAllowed ); - connect( mListView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged() ) ); + connect( mListView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged() ) ); } } -bool KeySelectionDialog::checkKeys( const QValueList<QListViewItem*>& keys ) const +bool KeySelectionDialog::checkKeys( const TQValueList<TQListViewItem*>& keys ) const { KProgressDialog* pProgressDlg = 0; bool keysAllowed = true; @@ -1009,7 +1009,7 @@ bool KeySelectionDialog::checkKeys( const QValueList<QListViewItem*>& keys ) con pProgressDlg->setMinimumDuration( 1000 ); pProgressDlg->show(); - for( QValueList<QListViewItem*>::ConstIterator it = keys.begin(); + for( TQValueList<TQListViewItem*>::ConstIterator it = keys.begin(); it != keys.end(); ++it ) { kdDebug(5100) << "Checking key 0x" << getKeyId( *it ) << "...\n"; @@ -1028,7 +1028,7 @@ bool KeySelectionDialog::checkKeys( const QValueList<QListViewItem*>& keys ) con } -void KeySelectionDialog::slotRMB( QListViewItem* lvi, const QPoint& pos, int ) +void KeySelectionDialog::slotRMB( TQListViewItem* lvi, const TQPoint& pos, int ) { if( !lvi ) { return; @@ -1036,8 +1036,8 @@ void KeySelectionDialog::slotRMB( QListViewItem* lvi, const QPoint& pos, int ) mCurrentContextMenuItem = lvi; - QPopupMenu menu(this); - menu.insertItem( i18n( "Recheck Key" ), this, SLOT( slotRecheckKey() ) ); + TQPopupMenu menu(this); + menu.insertItem( i18n( "Recheck Key" ), this, TQT_SLOT( slotRecheckKey() ) ); menu.exec( pos ); } @@ -1070,7 +1070,7 @@ void KeySelectionDialog::slotCancel() reject(); } -void KeySelectionDialog::slotSearch( const QString & text ) +void KeySelectionDialog::slotSearch( const TQString & text ) { mSearchText = text.stripWhiteSpace().upper(); mStartSearchTimer->start( sCheckSelectionDelay, true /*single-shot*/ ); @@ -1084,7 +1084,7 @@ void KeySelectionDialog::slotFilter() } // OK, so we need to filter: - QRegExp keyIdRegExp( "(?:0x)?[A-F0-9]{1,8}", false /*case-insens.*/ ); + TQRegExp keyIdRegExp( "(?:0x)?[A-F0-9]{1,8}", false /*case-insens.*/ ); if ( keyIdRegExp.exactMatch( mSearchText ) ) { if ( mSearchText.startsWith( "0X" ) ) // search for keyID only: @@ -1098,52 +1098,52 @@ void KeySelectionDialog::slotFilter() } } -void KeySelectionDialog::filterByKeyID( const QString & keyID ) +void KeySelectionDialog::filterByKeyID( const TQString & keyID ) { assert( keyID.length() <= 8 ); assert( !keyID.isEmpty() ); // regexp in slotFilter should prevent these if ( keyID.isEmpty() ) showAllItems(); else - for ( QListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) + for ( TQListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) item->setVisible( item->text( 0 ).upper().startsWith( keyID ) ); } -void KeySelectionDialog::filterByKeyIDOrUID( const QString & str ) +void KeySelectionDialog::filterByKeyIDOrUID( const TQString & str ) { assert( !str.isEmpty() ); // match beginnings of words: - QRegExp rx( "\\b" + QRegExp::escape( str ), false ); + TQRegExp rx( "\\b" + TQRegExp::escape( str ), false ); - for ( QListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) + for ( TQListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) item->setVisible( item->text( 0 ).upper().startsWith( str ) || rx.search( item->text( 1 ) ) >= 0 || anyChildMatches( item, rx ) ); } -void KeySelectionDialog::filterByUID( const QString & str ) +void KeySelectionDialog::filterByUID( const TQString & str ) { assert( !str.isEmpty() ); // match beginnings of words: - QRegExp rx( "\\b" + QRegExp::escape( str ), false ); + TQRegExp rx( "\\b" + TQRegExp::escape( str ), false ); - for ( QListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) + for ( TQListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) item->setVisible( rx.search( item->text( 1 ) ) >= 0 || anyChildMatches( item, rx ) ); } -bool KeySelectionDialog::anyChildMatches( const QListViewItem * item, QRegExp & rx ) const +bool KeySelectionDialog::anyChildMatches( const TQListViewItem * item, TQRegExp & rx ) const { if ( !item ) return false; - QListViewItem * stop = item->nextSibling(); // It's OK if stop is NULL... + TQListViewItem * stop = item->nextSibling(); // It's OK if stop is NULL... - for ( QListViewItemIterator it( item->firstChild() ) ; it.current() && it.current() != stop ; ++it ) + for ( TQListViewItemIterator it( item->firstChild() ) ; it.current() && it.current() != stop ; ++it ) if ( rx.search( it.current()->text( 1 ) ) >= 0 ) { //item->setOpen( true ); // do we want that? return true; @@ -1153,47 +1153,47 @@ bool KeySelectionDialog::anyChildMatches( const QListViewItem * item, QRegExp & void KeySelectionDialog::showAllItems() { - for ( QListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) + for ( TQListViewItem * item = mListView->firstChild() ; item ; item = item->nextSibling() ) item->setVisible( true ); } // ------------------------------------------------------------------------ -KeyRequester::KeyRequester( QWidget * parent, bool multipleKeys, +KeyRequester::KeyRequester( TQWidget * parent, bool multipleKeys, unsigned int allowedKeys, const char * name ) - : QWidget( parent, name ), + : TQWidget( parent, name ), mDialogCaption( i18n("OpenPGP Key Selection") ), mDialogMessage( i18n("Please select an OpenPGP key to use.") ), mMulti( multipleKeys ), mAllowedKeys( allowedKeys ), d( 0 ) { - QHBoxLayout * hlay = new QHBoxLayout( this, 0, KDialog::spacingHint() ); + TQHBoxLayout * hlay = new TQHBoxLayout( this, 0, KDialog::spacingHint() ); // the label where the key id is to be displayed: - mLabel = new QLabel( this ); - mLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mLabel = new TQLabel( this ); + mLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); // the button to unset any key: - mEraseButton = new QPushButton( this ); + mEraseButton = new TQPushButton( this ); mEraseButton->setAutoDefault( false ); - mEraseButton->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, - QSizePolicy::Minimum ) ); + mEraseButton->setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, + TQSizePolicy::Minimum ) ); mEraseButton->setPixmap( SmallIcon( "clear_left" ) ); - QToolTip::add( mEraseButton, i18n("Clear") ); + TQToolTip::add( mEraseButton, i18n("Clear") ); // the button to call the KeySelectionDialog: - mDialogButton = new QPushButton( i18n("Change..."), this ); + mDialogButton = new TQPushButton( i18n("Change..."), this ); mDialogButton->setAutoDefault( false ); hlay->addWidget( mLabel, 1 ); hlay->addWidget( mEraseButton ); hlay->addWidget( mDialogButton ); - connect( mEraseButton, SIGNAL(clicked()), SLOT(slotEraseButtonClicked()) ); - connect( mDialogButton, SIGNAL(clicked()), SLOT(slotDialogButtonClicked()) ); + connect( mEraseButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotEraseButtonClicked()) ); + connect( mDialogButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotDialogButtonClicked()) ); - setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, - QSizePolicy::Fixed ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding, + TQSizePolicy::Fixed ) ); } KeyRequester::~KeyRequester() { @@ -1213,11 +1213,11 @@ void KeyRequester::setKeyIDs( const KeyIDList & keyIDs ) { if ( mKeys.size() > 1 ) setMultipleKeysEnabled( true ); - QString s = mKeys.toStringList().join(", "); + TQString s = mKeys.toStringList().join(", "); mLabel->setText( s ); - QToolTip::remove( mLabel ); - QToolTip::add( mLabel, s ); + TQToolTip::remove( mLabel ); + TQToolTip::add( mLabel, s ); } void KeyRequester::slotDialogButtonClicked() { @@ -1238,11 +1238,11 @@ void KeyRequester::slotEraseButtonClicked() { emit changed(); } -void KeyRequester::setDialogCaption( const QString & caption ) { +void KeyRequester::setDialogCaption( const TQString & caption ) { mDialogCaption = caption; } -void KeyRequester::setDialogMessage( const QString & msg ) { +void KeyRequester::setDialogMessage( const TQString & msg ) { mDialogMessage = msg; } @@ -1268,7 +1268,7 @@ void KeyRequester::setAllowedKeys( int allowedKeys ) { } -PublicKeyRequester::PublicKeyRequester( QWidget * parent, bool multi, +PublicKeyRequester::PublicKeyRequester( TQWidget * parent, bool multi, unsigned int allowed, const char * name ) : KeyRequester( parent, multi, allowed & ~SecretKeys, name ) { @@ -1281,10 +1281,10 @@ PublicKeyRequester::~PublicKeyRequester() { KeyIDList PublicKeyRequester::keyRequestHook( Module * pgp ) const { assert( pgp ); - return pgp->selectPublicKeys( mDialogCaption, mDialogMessage, mKeys, QString::null, mAllowedKeys ); + return pgp->selectPublicKeys( mDialogCaption, mDialogMessage, mKeys, TQString::null, mAllowedKeys ); } -SecretKeyRequester::SecretKeyRequester( QWidget * parent, bool multi, +SecretKeyRequester::SecretKeyRequester( TQWidget * parent, bool multi, unsigned int allowed, const char * name ) : KeyRequester( parent, multi, allowed & ~PublicKeys, name ) { @@ -1307,10 +1307,10 @@ KeyIDList SecretKeyRequester::keyRequestHook( Module * pgp ) const { // ------------------------------------------------------------------------ -KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, - const QValueVector<KeyIDList>& keyIDs, +KeyApprovalDialog::KeyApprovalDialog( const TQStringList& addresses, + const TQValueVector<KeyIDList>& keyIDs, const int allowedKeys, - QWidget *parent, const char *name, + TQWidget *parent, const char *name, bool modal ) : KDialogBase( parent, name, modal, i18n("Encryption Key Approval"), Ok|Cancel, Ok ), @@ -1328,23 +1328,23 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, // addresses.count()+1 != keyList.count() ) // do something; - QFrame *page = makeMainWidget(); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + TQFrame *page = makeMainWidget(); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); - QLabel *label = new QLabel( i18n("The following keys will be used for " + TQLabel *label = new TQLabel( i18n("The following keys will be used for " "encryption:"), page ); topLayout->addWidget( label ); - QScrollView* sv = new QScrollView( page ); - sv->setResizePolicy( QScrollView::AutoOneFit ); + TQScrollView* sv = new TQScrollView( page ); + sv->setResizePolicy( TQScrollView::AutoOneFit ); topLayout->addWidget( sv ); - QVBox* bigvbox = new QVBox( sv->viewport() ); + TQVBox* bigvbox = new TQVBox( sv->viewport() ); bigvbox->setMargin( KDialog::marginHint() ); bigvbox->setSpacing( KDialog::spacingHint() ); sv->addChild( bigvbox ); - QButtonGroup *mChangeButtonGroup = new QButtonGroup( bigvbox ); + TQButtonGroup *mChangeButtonGroup = new TQButtonGroup( bigvbox ); mChangeButtonGroup->hide(); mAddressLabels.resize( addresses.count() ); mKeyIdsLabels.resize( keyIDs.size() ); @@ -1354,28 +1354,28 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, // the sender's key if( pgp->encryptToSelf() ) { mEncryptToSelf = 1; - QHBox* hbox = new QHBox( bigvbox ); - new QLabel( i18n("Your keys:"), hbox ); - QLabel* keyidsL = new QLabel( hbox ); + TQHBox* hbox = new TQHBox( bigvbox ); + new TQLabel( i18n("Your keys:"), hbox ); + TQLabel* keyidsL = new TQLabel( hbox ); if( keyIDs[0].isEmpty() ) { keyidsL->setText( i18n("<none> means 'no key'", "<none>") ); } else { keyidsL->setText( "0x" + keyIDs[0].toStringList().join( "\n0x" ) ); } - keyidsL->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + keyidsL->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); /* - QListBox* keyidLB = new QListBox( hbox ); + TQListBox* keyidLB = new TQListBox( hbox ); if( keyIDs[0].isEmpty() ) { keyidLB->insertItem( i18n("<none>") ); } else { keyidLB->insertStringList( keyIDs[0].toStringList() ); } - keyidLB->setSelectionMode( QListBox::NoSelection ); - keyidLB->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + keyidLB->setSelectionMode( TQListBox::NoSelection ); + keyidLB->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); */ - QPushButton *button = new QPushButton( i18n("Change..."), hbox ); + TQPushButton *button = new TQPushButton( i18n("Change..."), hbox ); mChangeButtonGroup->insert( button ); button->setAutoDefault( false ); hbox->setStretchFactor( keyidsL, 10 ); @@ -1392,8 +1392,8 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, //mKeyIdListBoxes.insert( 0, 0 ); } - QStringList::ConstIterator ait; - QValueVector<KeyIDList>::const_iterator kit; + TQStringList::ConstIterator ait; + TQValueVector<KeyIDList>::const_iterator kit; int i; for( ait = addresses.begin(), kit = keyIDs.begin(), i = 0; ( ait != addresses.end() ) && ( kit != keyIDs.end() ); @@ -1405,34 +1405,34 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, new KSeparator( Horizontal, bigvbox ); } - QHBox *hbox = new QHBox( bigvbox ); - new QLabel( i18n("Recipient:"), hbox ); - QLabel *addressL = new QLabel( *ait, hbox ); + TQHBox *hbox = new TQHBox( bigvbox ); + new TQLabel( i18n("Recipient:"), hbox ); + TQLabel *addressL = new TQLabel( *ait, hbox ); hbox->setStretchFactor( addressL, 10 ); mAddressLabels.insert( i, addressL ); - hbox = new QHBox( bigvbox ); - new QLabel( i18n("Encryption keys:"), hbox ); - QLabel* keyidsL = new QLabel( hbox ); + hbox = new TQHBox( bigvbox ); + new TQLabel( i18n("Encryption keys:"), hbox ); + TQLabel* keyidsL = new TQLabel( hbox ); if( (*kit).isEmpty() ) { keyidsL->setText( i18n("<none> means 'no key'", "<none>") ); } else { keyidsL->setText( "0x" + (*kit).toStringList().join( "\n0x" ) ); } - keyidsL->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + keyidsL->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); /* - QListBox* keyidLB = new QListBox( hbox ); + TQListBox* keyidLB = new TQListBox( hbox ); if( (*kit).isEmpty() ) { keyidLB->insertItem( i18n("<none>") ); } else { keyidLB->insertStringList( (*kit).toStringList() ); } - keyidLB->setSelectionMode( QListBox::NoSelection ); - keyidLB->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + keyidLB->setSelectionMode( TQListBox::NoSelection ); + keyidLB->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); */ - QPushButton *button = new QPushButton( i18n("Change..."), hbox ); + TQPushButton *button = new TQPushButton( i18n("Change..."), hbox ); mChangeButtonGroup->insert( button ); button->setAutoDefault( false ); hbox->setStretchFactor( keyidsL, 10 ); @@ -1440,9 +1440,9 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, //hbox->setStretchFactor( keyidLB, 10 ); //mKeyIdListBoxes.insert( i + 1, keyidLB ); - hbox = new QHBox( bigvbox ); - new QLabel( i18n("Encryption preference:"), hbox ); - QComboBox *encrPrefCombo = new QComboBox( hbox ); + hbox = new TQHBox( bigvbox ); + new TQLabel( i18n("Encryption preference:"), hbox ); + TQComboBox *encrPrefCombo = new TQComboBox( hbox ); encrPrefCombo->insertItem( i18n("<none>") ); encrPrefCombo->insertItem( i18n("Never Encrypt with This Key") ); encrPrefCombo->insertItem( i18n("Always Encrypt with This Key") ); @@ -1470,12 +1470,12 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, default: encrPrefCombo->setCurrentItem( 0 ); } - connect( encrPrefCombo, SIGNAL(activated(int)), - this, SLOT(slotPrefsChanged(int)) ); + connect( encrPrefCombo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotPrefsChanged(int)) ); mEncrPrefCombos.insert( i, encrPrefCombo ); } - connect( mChangeButtonGroup, SIGNAL(clicked(int)), - this, SLOT(slotChangeEncryptionKey(int)) ); + connect( mChangeButtonGroup, TQT_SIGNAL(clicked(int)), + this, TQT_SLOT(slotChangeEncryptionKey(int)) ); // calculate the optimal width for the dialog int dialogWidth = marginHint() @@ -1498,7 +1498,7 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, + marginHint() + 2; // don't make the dialog too large - QRect desk = KGlobalSettings::desktopGeometry(this); + TQRect desk = KGlobalSettings::desktopGeometry(this); int screenWidth = desk.width(); if( dialogWidth > 3*screenWidth/4 ) dialogWidth = 3*screenWidth/4; @@ -1506,7 +1506,7 @@ KeyApprovalDialog::KeyApprovalDialog( const QStringList& addresses, if( dialogHeight > 7*screenHeight/8 ) dialogHeight = 7*screenHeight/8; - setInitialSize( QSize( dialogWidth, dialogHeight ) ); + setInitialSize( TQSize( dialogWidth, dialogHeight ) ); } void @@ -1550,10 +1550,10 @@ KeyApprovalDialog::slotChangeEncryptionKey( int nr ) } if( !keyIds.isEmpty() ) { mKeys[nr] = keyIds; - QLabel* keyidsL = mKeyIdsLabels[nr]; + TQLabel* keyidsL = mKeyIdsLabels[nr]; keyidsL->setText( "0x" + keyIds.toStringList().join( "\n0x" ) ); /* - QListBox* qlb = mKeyIdListBoxes[nr]; + TQListBox* qlb = mKeyIdListBoxes[nr]; qlb->clear(); qlb->insertStringList( keyIds.toStringList() ); */ @@ -1613,31 +1613,31 @@ KeyApprovalDialog::slotCancel() // ------------------------------------------------------------------------ -CipherTextDialog::CipherTextDialog( const QCString & text, - const QCString & charset, QWidget *parent, +CipherTextDialog::CipherTextDialog( const TQCString & text, + const TQCString & charset, TQWidget *parent, const char *name, bool modal ) :KDialogBase( parent, name, modal, i18n("OpenPGP Information"), Ok|Cancel, Ok) { // FIXME (post KDE2.2): show some more info, e.g. the output of GnuPG/PGP - QFrame *page = makeMainWidget(); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + TQFrame *page = makeMainWidget(); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); - QLabel *label = new QLabel( page ); + TQLabel *label = new TQLabel( page ); label->setText(i18n("Result of the last encryption/sign operation:")); topLayout->addWidget( label ); - mEditBox = new QMultiLineEdit( page ); + mEditBox = new TQMultiLineEdit( page ); mEditBox->setReadOnly(true); topLayout->addWidget( mEditBox, 10 ); - QString unicodeText; + TQString unicodeText; if (charset.isEmpty()) - unicodeText = QString::fromLocal8Bit(text.data()); + unicodeText = TQString::fromLocal8Bit(text.data()); else { bool ok=true; - QTextCodec *codec = KGlobal::charsets()->codecForName(charset, ok); + TQTextCodec *codec = KGlobal::charsets()->codecForName(charset, ok); if(!ok) - unicodeText = QString::fromLocal8Bit(text.data()); + unicodeText = TQString::fromLocal8Bit(text.data()); else unicodeText = codec->toUnicode(text.data(), text.length()); } @@ -1665,12 +1665,12 @@ void CipherTextDialog::setMinimumSize() KConfig gc("kdeglobals", false, false); gc.setGroup("Windows"); int maxWidth; - if (QApplication::desktop()->isVirtualDesktop() && + if (TQApplication::desktop()->isVirtualDesktop() && gc.readBoolEntry("XineramaEnabled", true) && gc.readBoolEntry("XineramaPlacementEnabled", true)) { - maxWidth = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(parentWidget())).width()-100; + maxWidth = TQApplication::desktop()->screenGeometry(TQApplication::desktop()->screenNumber(parentWidget())).width()-100; } else { - maxWidth = QApplication::desktop()->geometry().width()-100; + maxWidth = TQApplication::desktop()->geometry().width()-100; } #endif diff --git a/libkpgp/kpgpui.h b/libkpgp/kpgpui.h index eab9a53ea..48e6fecde 100644 --- a/libkpgp/kpgpui.h +++ b/libkpgp/kpgpui.h @@ -20,12 +20,12 @@ #define KPGPUI_H #include <kdialogbase.h> // base class of all dialogs here -#include <qwidget.h> // base class of Config -#include <qcheckbox.h> // used in inlined methods +#include <tqwidget.h> // base class of Config +#include <tqcheckbox.h> // used in inlined methods #include <kdebug.h> // used in inlined methods -#include <qcstring.h> // used in return-by-value -#include <qstring.h> // is a member in KeyRequester -#include <qvaluevector.h> // used in KeyApprovalDialog +#include <tqcstring.h> // used in return-by-value +#include <tqstring.h> // is a member in KeyRequester +#include <tqvaluevector.h> // used in KeyApprovalDialog #include "kpgp.h" @@ -57,8 +57,8 @@ class KDE_EXPORT PassphraseDialog : public KDialogBase Q_OBJECT public: - PassphraseDialog( QWidget *parent=0, const QString &caption=QString::null, - bool modal=true, const QString &keyID=QString::null); + PassphraseDialog( TQWidget *parent=0, const TQString &caption=TQString::null, + bool modal=true, const TQString &keyID=TQString::null); virtual ~PassphraseDialog(); const char * passphrase(); @@ -77,23 +77,23 @@ class KDE_EXPORT Config : public QWidget Q_OBJECT public: - Config(QWidget *parent = 0, const char *name = 0, bool encrypt =true); + Config(TQWidget *parent = 0, const char *name = 0, bool encrypt =true); virtual ~Config(); virtual void setValues(); virtual void applySettings(); - QGroupBox* optionsGroupBox() { return mpOptionsGroupBox; }; + TQGroupBox* optionsGroupBox() { return mpOptionsGroupBox; }; signals: void changed(); protected: Module *pgp; - QCheckBox *storePass; - QCheckBox *encToSelf; - QCheckBox *showCipherText; - QCheckBox *showKeyApprovalDlg; - QComboBox *toolCombo; - QGroupBox* mpOptionsGroupBox; + TQCheckBox *storePass; + TQCheckBox *encToSelf; + TQCheckBox *showCipherText; + TQCheckBox *showKeyApprovalDlg; + TQComboBox *toolCombo; + TQGroupBox* mpOptionsGroupBox; }; @@ -112,13 +112,13 @@ class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper /** allowedKeys: see kpgp.h */ KeySelectionDialog( const KeyList& keyList, - const QString& title, - const QString& text = QString::null, + const TQString& title, + const TQString& text = TQString::null, const KeyIDList& keyIds = KeyIDList(), const bool rememberChoice = false, const unsigned int allowedKeys = AllKeys, const bool extendedSelection = false, - QWidget *parent=0, const char *name=0, + TQWidget *parent=0, const char *name=0, bool modal=true ); virtual ~KeySelectionDialog(); @@ -139,37 +139,37 @@ class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper protected slots: virtual void slotRereadKeys(); - virtual void slotSelectionChanged( QListViewItem* ); + virtual void slotSelectionChanged( TQListViewItem* ); virtual void slotSelectionChanged(); - virtual void slotCheckSelection( QListViewItem* = 0 ); - virtual void slotRMB( QListViewItem*, const QPoint&, int ); + virtual void slotCheckSelection( TQListViewItem* = 0 ); + virtual void slotRMB( TQListViewItem*, const TQPoint&, int ); virtual void slotRecheckKey(); virtual void slotOk(); virtual void slotCancel(); - virtual void slotSearch( const QString & text ); + virtual void slotSearch( const TQString & text ); virtual void slotFilter(); private: - void filterByKeyID( const QString & keyID ); - void filterByKeyIDOrUID( const QString & keyID ); - void filterByUID( const QString & uid ); + void filterByKeyID( const TQString & keyID ); + void filterByKeyIDOrUID( const TQString & keyID ); + void filterByUID( const TQString & uid ); void showAllItems(); - bool anyChildMatches( const QListViewItem * item, QRegExp & rx ) const; + bool anyChildMatches( const TQListViewItem * item, TQRegExp & rx ) const; void initKeylist( const KeyList& keyList, const KeyIDList& keyIds ); - QString keyInfo( const Kpgp::Key* ) const; + TQString keyInfo( const Kpgp::Key* ) const; - QString beautifyFingerprint( const QCString& ) const; + TQString beautifyFingerprint( const TQCString& ) const; - // Returns the key ID of the key the given QListViewItem belongs to - KeyID getKeyId( const QListViewItem* ) const; + // Returns the key ID of the key the given TQListViewItem belongs to + KeyID getKeyId( const TQListViewItem* ) const; // Returns: -1 = unusable, 0 = unknown, 1 = valid, but untrusted, 2 = trusted int keyValidity( const Kpgp::Key* ) const; - // Updates the given QListViewItem with the data of the given key - void updateKeyInfo( const Kpgp::Key*, QListViewItem* ) const; + // Updates the given TQListViewItem with the data of the given key + void updateKeyInfo( const Kpgp::Key*, TQListViewItem* ) const; /** Checks if choosing the given key is allowed Returns: @@ -178,22 +178,22 @@ class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper or not, 1 = key can be chosen */ - int keyAdmissibility( QListViewItem*, + int keyAdmissibility( TQListViewItem*, TrustCheckMode = NoExpensiveTrustCheck ) const; // Perform expensive trust checks for the given keys - bool checkKeys( const QValueList<QListViewItem*>& ) const; + bool checkKeys( const TQValueList<TQListViewItem*>& ) const; private: KListView *mListView; - QCheckBox *mRememberCB; - QPixmap *mKeyGoodPix, *mKeyBadPix, *mKeyUnknownPix, *mKeyValidPix; + TQCheckBox *mRememberCB; + TQPixmap *mKeyGoodPix, *mKeyBadPix, *mKeyUnknownPix, *mKeyValidPix; KeyIDList mKeyIds; unsigned int mAllowedKeys; - QTimer* mCheckSelectionTimer; - QTimer* mStartSearchTimer; - QString mSearchText; - QListViewItem* mCurrentContextMenuItem; + TQTimer* mCheckSelectionTimer; + TQTimer* mStartSearchTimer; + TQString mSearchText; + TQListViewItem* mCurrentContextMenuItem; static const int sCheckSelectionDelay; }; @@ -203,18 +203,18 @@ class KDE_EXPORT KeyRequester: public QWidget Q_OBJECT public: - KeyRequester( QWidget * parent=0, bool multipleKeys=false, + KeyRequester( TQWidget * parent=0, bool multipleKeys=false, unsigned int allowedKeys=AllKeys, const char * name=0 ); virtual ~KeyRequester(); KeyIDList keyIDs() const; void setKeyIDs( const KeyIDList & keyIDs ); - QPushButton * eraseButton() const { return mEraseButton; } - QPushButton * dialogButton() const { return mDialogButton; } + TQPushButton * eraseButton() const { return mEraseButton; } + TQPushButton * dialogButton() const { return mDialogButton; } - void setDialogCaption( const QString & caption ); - void setDialogMessage( const QString & message ); + void setDialogCaption( const TQString & caption ); + void setDialogMessage( const TQString & message ); bool isMultipleKeysEnabled() const; void setMultipleKeysEnabled( bool enable ); @@ -227,10 +227,10 @@ protected: virtual KeyIDList keyRequestHook( Module * pgp ) const = 0; protected: - QLabel * mLabel; - QPushButton * mEraseButton; - QPushButton * mDialogButton; - QString mDialogCaption, mDialogMessage; + TQLabel * mLabel; + TQPushButton * mEraseButton; + TQPushButton * mDialogButton; + TQString mDialogCaption, mDialogMessage; bool mMulti; int mAllowedKeys; KeyIDList mKeys; @@ -253,7 +253,7 @@ protected: class KDE_EXPORT PublicKeyRequester : public KeyRequester { Q_OBJECT public: - PublicKeyRequester( QWidget * parent=0, bool multipleKeys=false, + PublicKeyRequester( TQWidget * parent=0, bool multipleKeys=false, unsigned int allowedKeys=PublicKeys, const char * name=0 ); virtual ~PublicKeyRequester(); @@ -272,7 +272,7 @@ protected: class KDE_EXPORT SecretKeyRequester : public KeyRequester { Q_OBJECT public: - SecretKeyRequester( QWidget * parent=0, bool multipleKeys=false, + SecretKeyRequester( TQWidget * parent=0, bool multipleKeys=false, unsigned int allowedKeys=SecretKeys, const char * name=0 ); virtual ~SecretKeyRequester(); @@ -294,14 +294,14 @@ class KDE_EXPORT KeyApprovalDialog: public KDialogBase Q_OBJECT public: - KeyApprovalDialog( const QStringList&, - const QValueVector<KeyIDList>&, + KeyApprovalDialog( const TQStringList&, + const TQValueVector<KeyIDList>&, const int allowedKeys, - QWidget *parent = 0, const char *name = 0, + TQWidget *parent = 0, const char *name = 0, bool modal = true ); virtual ~KeyApprovalDialog() {}; - QValueVector<KeyIDList> keys() const { return mKeys; }; + TQValueVector<KeyIDList> keys() const { return mKeys; }; bool preferencesChanged() const { return mPrefsChanged; } @@ -312,14 +312,14 @@ class KDE_EXPORT KeyApprovalDialog: public KDialogBase virtual void slotCancel(); private: - QValueVector<KeyIDList> mKeys; + TQValueVector<KeyIDList> mKeys; int mAllowedKeys; int mEncryptToSelf; bool mPrefsChanged; - QPtrVector<QLabel> mAddressLabels; - QPtrVector<QLabel> mKeyIdsLabels; - //QPtrVector<QListBox> mKeyIdListBoxes; - QPtrVector<QComboBox> mEncrPrefCombos; + TQPtrVector<TQLabel> mAddressLabels; + TQPtrVector<TQLabel> mKeyIdsLabels; + //TQPtrVector<TQListBox> mKeyIdListBoxes; + TQPtrVector<TQComboBox> mEncrPrefCombos; }; @@ -329,13 +329,13 @@ class KDE_EXPORT CipherTextDialog: public KDialogBase Q_OBJECT public: - CipherTextDialog( const QCString & text, const QCString & charset=0, - QWidget *parent=0, const char *name=0, bool modal=true ); + CipherTextDialog( const TQCString & text, const TQCString & charset=0, + TQWidget *parent=0, const char *name=0, bool modal=true ); virtual ~CipherTextDialog() {}; private: void setMinimumSize(); - QMultiLineEdit *mEditBox; + TQMultiLineEdit *mEditBox; }; } // namespace Kpgp |