summaryrefslogtreecommitdiffstats
path: root/libkpgp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /libkpgp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkpgp')
-rw-r--r--libkpgp/kpgp.cpp44
-rw-r--r--libkpgp/kpgp.h20
-rw-r--r--libkpgp/kpgpbase.cpp60
-rw-r--r--libkpgp/kpgpbase.h2
-rw-r--r--libkpgp/kpgpbase2.cpp196
-rw-r--r--libkpgp/kpgpbase5.cpp150
-rw-r--r--libkpgp/kpgpbase6.cpp148
-rw-r--r--libkpgp/kpgpbaseG.cpp140
-rw-r--r--libkpgp/kpgpblock.cpp6
-rw-r--r--libkpgp/kpgpblock.h36
-rw-r--r--libkpgp/kpgpkey.cpp2
-rw-r--r--libkpgp/kpgpkey.h4
-rw-r--r--libkpgp/kpgpui.cpp54
-rw-r--r--libkpgp/kpgpui.h32
14 files changed, 451 insertions, 443 deletions
diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp
index 53b77913f..f3227ac31 100644
--- a/libkpgp/kpgp.cpp
+++ b/libkpgp/kpgp.cpp
@@ -828,7 +828,7 @@ Module::rereadKey( const KeyID& keyID, const bool readTrust /* = true */ )
return newKey;
}
-QCString
+TQCString
Module::getAsciiPublicKey(const KeyID& keyID)
{
if (0 == pgp) assignPGPBase();
@@ -885,7 +885,7 @@ Module::clear(const bool erasePassPhrase)
wipePassPhrase(true);
}
-const QString
+const TQString
Module::lastErrorMsg(void) const
{
return errMsg;
@@ -930,9 +930,9 @@ Module::selectSecretKey( const TQString& title,
KeyID
Module::selectPublicKey( const TQString& title,
- const TQString& text /* = TQString::null */,
+ const TQString& text /* = TQString() */,
const KeyID& oldKeyId /* = KeyID() */,
- const TQString& address /* = TQString::null */,
+ const TQString& address /* = TQString() */,
const unsigned int allowedKeys /* = AllKeys */ )
{
if( 0 == pgp ) {
@@ -966,9 +966,9 @@ Module::selectPublicKey( const TQString& title,
KeyIDList
Module::selectPublicKeys( const TQString& title,
- const TQString& text /* = TQString::null */,
+ const TQString& text /* = TQString() */,
const KeyIDList& oldKeyIds /* = KeyIDList() */,
- const TQString& address /* = TQString::null */,
+ const TQString& address /* = TQString() */,
const unsigned int allowedKeys /* = AllKeys */ )
{
if( 0 == pgp ) {
@@ -1044,7 +1044,7 @@ Module::prepareMessageForDecryption( const TQCString& msg,
start = 0;
else
{
- start = msg.find( "\n-----BEGIN PGP" ) + 1;
+ start = msg.tqfind( "\n-----BEGIN PGP" ) + 1;
if( start == 0 )
{
nonPgpBlocks.append( msg );
@@ -1062,20 +1062,20 @@ Module::prepareMessageForDecryption( const TQCString& msg,
else
pgpBlock = UnknownBlock;
- nextEnd = msg.find( "\n-----END PGP", start + 15 );
+ nextEnd = msg.tqfind( "\n-----END PGP", start + 15 );
if( nextEnd == -1 )
{
nonPgpBlocks.append( msg.mid( lastEnd+1 ) );
break;
}
- nextStart = msg.find( "\n-----BEGIN PGP", start + 15 );
+ nextStart = msg.tqfind( "\n-----BEGIN PGP", start + 15 );
if( ( nextStart == -1 ) || ( nextEnd < nextStart ) ||
( pgpBlock == ClearsignedBlock ) )
{ // most likely we found a PGP block (but we don't check if it's valid)
// store the preceding non-PGP block
nonPgpBlocks.append( msg.mid( lastEnd+1, start-lastEnd-1 ) );
- lastEnd = msg.find( "\n", nextEnd + 14 );
+ lastEnd = msg.tqfind( "\n", nextEnd + 14 );
if( lastEnd == -1 )
{
pgpBlocks.append( new Block( msg.mid( start ) ) );
@@ -1086,7 +1086,7 @@ Module::prepareMessageForDecryption( const TQCString& msg,
{
pgpBlocks.append( new Block( msg.mid( start, lastEnd+1-start ) ) );
if( ( nextStart != -1 ) && ( nextEnd > nextStart ) )
- nextStart = msg.find( "\n-----BEGIN PGP", lastEnd+1 );
+ nextStart = msg.tqfind( "\n-----BEGIN PGP", lastEnd+1 );
}
}
@@ -1333,7 +1333,7 @@ Module::checkForPGP(void)
havePgp=FALSE;
path = getenv("PATH");
- while((index = path.find(":",lastindex+1)) != -1)
+ while((index = path.tqfind(":",lastindex+1)) != -1)
{
pSearchPaths.append(path.mid(lastindex+1,index-lastindex-1));
lastindex = index;
@@ -1478,7 +1478,7 @@ Module::assignPGPBase(void)
}
}
-QString
+TQString
Module::canonicalAddress( const TQString& _adress )
{
int index,index2;
@@ -1487,12 +1487,12 @@ Module::canonicalAddress( const TQString& _adress )
address = address.stripWhiteSpace();
// just leave pure e-mail address.
- if((index = address.find("<")) != -1)
- if((index2 = address.find("@",index+1)) != -1)
- if((index2 = address.find(">",index2+1)) != -1)
+ if((index = address.tqfind("<")) != -1)
+ if((index2 = address.tqfind("@",index+1)) != -1)
+ if((index2 = address.tqfind(">",index2+1)) != -1)
return address.mid(index,index2-index+1);
- if((index = address.find("@")) == -1)
+ if((index = address.tqfind("@")) == -1)
{
// local address
//char hostname[1024];
@@ -1503,7 +1503,7 @@ Module::canonicalAddress( const TQString& _adress )
else
{
int index1 = address.findRev(" ",index);
- int index2 = address.find(" ",index);
+ int index2 = address.tqfind(" ",index);
if(index2 == -1) index2 = address.length();
return "<" + address.mid(index1+1 ,index2-index1-1) + ">";
}
@@ -1598,7 +1598,7 @@ Module::readSecretKeys( bool reread )
KeyID
Module::selectKey( const KeyList& keys,
const TQString& title,
- const TQString& text /* = TQString::null */ ,
+ const TQString& text /* = TQString() */ ,
const KeyID& keyId /* = KeyID() */ ,
const unsigned int allowedKeys /* = AllKeys */ )
{
@@ -1621,7 +1621,7 @@ Module::selectKey( const KeyList& keys,
KeyIDList
Module::selectKeys( const KeyList& keys,
const TQString& title,
- const TQString& text /* = TQString::null */ ,
+ const TQString& text /* = TQString() */ ,
const KeyIDList& keyIds /* = KeyIDList() */ ,
const unsigned int allowedKeys /* = AllKeys */ )
{
@@ -1646,7 +1646,7 @@ KeyID
Module::selectKey( bool& rememberChoice,
const KeyList& keys,
const TQString& title,
- const TQString& text /* = TQString::null */ ,
+ const TQString& text /* = TQString() */ ,
const KeyID& keyId /* = KeyID() */ ,
const unsigned int allowedKeys /* = AllKeys */ )
{
@@ -1674,7 +1674,7 @@ KeyIDList
Module::selectKeys( bool& rememberChoice,
const KeyList& keys,
const TQString& title,
- const TQString& text /* = TQString::null */ ,
+ const TQString& text /* = TQString() */ ,
const KeyIDList& keyIds /* = KeyIDList() */ ,
const unsigned int allowedKeys /* = AllKeys */ )
{
diff --git a/libkpgp/kpgp.h b/libkpgp/kpgp.h
index ec937015b..da6c02e17 100644
--- a/libkpgp/kpgp.h
+++ b/libkpgp/kpgp.h
@@ -258,7 +258,7 @@ public:
corresponding key is selected.
*/
KeyID selectSecretKey( const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyID& keyId = KeyID() );
/** Shows a key selection dialog with all public keys and the given title
@@ -268,9 +268,9 @@ public:
<em>mode</em> specifies which keys can be selected.
*/
KeyID selectPublicKey( const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyID& oldKeyId = KeyID(),
- const TQString& address = TQString::null,
+ const TQString& address = TQString(),
const unsigned int allowedKeys = AllKeys );
/** Shows a key selection dialog with all public keys and the given title
@@ -280,9 +280,9 @@ public:
<em>mode</em> specifies which keys can be selected.
*/
KeyIDList selectPublicKeys( const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyIDList& oldKeyIds = KeyIDList(),
- const TQString& address = TQString::null,
+ const TQString& address = TQString(),
const unsigned int allowedKeys = AllKeys );
// FIXME: key management
@@ -308,7 +308,7 @@ public:
/** Parses the given message and splits it into OpenPGP blocks and
Non-OpenPGP blocks.
- Returns TRUE if the message tqcontains at least one OpenPGP block and
+ Returns TRUE if the message contains at least one OpenPGP block and
FALSE otherwise.
The format is then:
<pre>
@@ -356,7 +356,7 @@ private:
*/
KeyID selectKey( const KeyList& keys,
const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyID& keyId = KeyID(),
const unsigned int allowedKeys = AllKeys );
@@ -364,7 +364,7 @@ private:
*/
KeyIDList selectKeys( const KeyList& keys,
const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyIDList& keyIds = KeyIDList(),
const unsigned int allowedKeys = AllKeys );
@@ -375,7 +375,7 @@ private:
KeyID selectKey( bool& rememberChoice,
const KeyList& keys,
const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyID& keyId = KeyID(),
const unsigned int allowedKeys = AllKeys );
@@ -386,7 +386,7 @@ private:
KeyIDList selectKeys( bool& rememberChoice,
const KeyList& keys,
const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyIDList& keyIds = KeyIDList(),
const unsigned int allowedKeys = AllKeys );
diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp
index ec2ffd126..5f31fe5ac 100644
--- a/libkpgp/kpgpbase.cpp
+++ b/libkpgp/kpgpbase.cpp
@@ -53,7 +53,7 @@ Base::clear()
input = TQCString();
output = TQCString();
error = TQCString();
- errMsg = TQString::null;
+ errMsg = TQString();
status = OK;
}
@@ -70,7 +70,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
int len, len2;
FILE *pass;
pid_t child_pid;
- int childExiStatus;
+ int childExitqStatus;
struct pollfd pollin, pollout, pollerr;
int pollstatus;
@@ -128,7 +128,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
_exit(127);
}
- /*Only get here if we're the parent.*/
+ /*Only get here if we're the tqparent.*/
close(pin[0]);
close(pout[1]);
close(perr[1]);
@@ -157,14 +157,14 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
//kdDebug(5100) << "Polling pin[1]..." << endl;
pollstatus = poll(&pollin, 1, 5);
if (pollstatus == 1) {
- //kdDebug(5100) << "Status for polling pin[1]: " << pollin.revents << endl;
+ //kdDebug(5100) << "tqStatus for polling pin[1]: " << pollin.revents << endl;
if (pollin.revents & POLLERR) {
kdDebug(5100) << "PGP seems to have hung up" << endl;
break;
}
else if (pollin.revents & POLLOUT) {
// search end of next line
- if ((len2 = input.find('\n', i)) == -1)
+ if ((len2 = input.tqfind('\n', i)) == -1)
len2 = input_length - i;
else
len2 = len2 - i + 1;
@@ -189,7 +189,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
//kdDebug(5100) << "Polling pout[0]..." << endl;
pollstatus = poll(&pollout, 1, 0);
if (pollstatus == 1) {
- //kdDebug(5100) << "Status for polling pout[0]: " << pollout.revents << endl;
+ //kdDebug(5100) << "tqStatus for polling pout[0]: " << pollout.revents << endl;
if (pollout.revents & POLLIN) {
//kdDebug(5100) << "Trying to read " << 1024 << " bytes from pout[0]" << endl;
if ((len = read(pout[0],str,1024))>0) {
@@ -214,7 +214,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
//kdDebug(5100) << "Polling perr[0]..." << endl;
pollstatus = poll(&pollerr, 1, 0);
if (pollstatus == 1) {
- //kdDebug(5100) << "Status for polling perr[0]: " << pollerr.revents << endl;
+ //kdDebug(5100) << "tqStatus for polling perr[0]: " << pollerr.revents << endl;
if (pollerr.revents & POLLIN) {
//kdDebug(5100) << "Trying to read " << 1024 << " bytes from perr[0]" << endl;
if ((len = read(perr[0],str,1024))>0) {
@@ -251,8 +251,8 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
do {
//kdDebug(5100) << "Checking if PGP is still running..." << endl;
- childExiStatus = 0;
- waitpidRetVal = waitpid(child_pid, &childExiStatus, WNOHANG);
+ childExitqStatus = 0;
+ waitpidRetVal = waitpid(child_pid, &childExitqStatus, WNOHANG);
//kdDebug(5100) << "waitpid returned " << waitpidRetVal << endl;
if (pout[0] >= 0) {
do {
@@ -260,7 +260,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
//kdDebug(5100) << "Polling pout[0]..." << endl;
pollstatus = poll(&pollout, 1, 0);
if (pollstatus == 1) {
- //kdDebug(5100) << "Status for polling pout[0]: " << pollout.revents << endl;
+ //kdDebug(5100) << "tqStatus for polling pout[0]: " << pollout.revents << endl;
if (pollout.revents & POLLIN) {
//kdDebug(5100) << "Trying to read " << 1024 << " bytes from pout[0]" << endl;
if ((len = read(pout[0],str,1024))>0) {
@@ -269,7 +269,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
output += str;
} else {
/*
- * Apparently, on NetBSD when the child dies, the pipe begins
+ * Aptqparently, on NetBSD when the child dies, the pipe begins
* receiving empty data packets *before* waitpid() has signaled
* that the child has died. Also, notice that this happens
* without any error bit being set in pollfd.revents (is this a
@@ -304,7 +304,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
//kdDebug(5100) << "Polling perr[0]..." << endl;
pollstatus = poll(&pollerr, 1, 0);
if (pollstatus == 1) {
- //kdDebug(5100) << "Status for polling perr[0]: " << pollerr.revents << endl;
+ //kdDebug(5100) << "tqStatus for polling perr[0]: " << pollerr.revents << endl;
if (pollerr.revents & POLLIN) {
//kdDebug(5100) << "Trying to read " << 1024 << " bytes from perr[0]" << endl;
if ((len = read(perr[0],str,1024))>0) {
@@ -313,7 +313,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
error += str;
} else {
/*
- * Apparently, on NetBSD when the child dies, the pipe begins
+ * Aptqparently, on NetBSD when the child dies, the pipe begins
* receiving empty data packets *before* waitpid() has signaled
* that the child has died. Also, notice that this happens
* without any error bit being set in pollfd.revents (is this a
@@ -351,14 +351,14 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
close(ppass[0]);
// Did the child exit normally?
- if (WIFEXITED(childExiStatus) != 0) {
+ if (WIFEXITED(childExitqStatus) != 0) {
// Get the return code of the child
- childExiStatus = WEXITSTATUS(childExiStatus);
- kdDebug(5100) << "PGP exited with exit status " << childExiStatus
+ childExitqStatus = WEXITSTATUS(childExitqStatus);
+ kdDebug(5100) << "PGP exited with exit status " << childExitqStatus
<< endl;
}
else {
- childExiStatus = -1;
+ childExitqStatus = -1;
kdDebug(5100) << "PGP exited abnormally!" << endl;
}
@@ -371,7 +371,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
*/
kdDebug(5100) << error << endl;
- return childExiStatus;
+ return childExitqStatus;
}
@@ -387,7 +387,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
int len, len2;
FILE *pass;
pid_t child_pid;
- int childExiStatus;
+ int childExitqStatus;
char gpgcmd[1024] = "\0";
struct pollfd poller[3];
int num_pollers = 0;
@@ -500,7 +500,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
_exit(127);
}
- // Only get here if we're the parent.
+ // Only get here if we're the tqparent.
close(pin[0]);
close(pout[1]);
@@ -529,8 +529,8 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
do {
//kdDebug(5100) << "Checking if GnuPG is still running..." << endl;
- childExiStatus = 0;
- waitpidRetVal = waitpid(child_pid, &childExiStatus, WNOHANG);
+ childExitqStatus = 0;
+ waitpidRetVal = waitpid(child_pid, &childExitqStatus, WNOHANG);
//kdDebug(5100) << "waitpid returned " << waitpidRetVal << endl;
do {
// poll the pipes
@@ -547,7 +547,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
else {
// FreeBSD/NetBSD workaround
//
- // Apparently, on Free/NetBSD when the child dies, the pipe begins
+ // Aptqparently, on Free/NetBSD when the child dies, the pipe begins
// receiving empty data packets *before* waitpid() has signaled
// that the child has died. Also, notice that this happens
// without any error bit being set in pollfd.revents (is this a
@@ -598,7 +598,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
else if (poller[STD_IN].revents & POLLOUT) {
if (!input.isEmpty()) {
// search end of next line
- if ((len2 = input.find('\n', input_pos)) == -1)
+ if ((len2 = input.tqfind('\n', input_pos)) == -1)
len2 = input_length - input_pos;
else
len2 = len2 - input_pos + 1;
@@ -645,14 +645,14 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
close(ppass[0]);
// Did the child exit normally?
- if (WIFEXITED(childExiStatus) != 0) {
+ if (WIFEXITED(childExitqStatus) != 0) {
// Get the return code of the child
- childExiStatus = WEXITSTATUS(childExiStatus);
- kdDebug(5100) << "GnuPG exited with exit status " << childExiStatus
+ childExitqStatus = WEXITSTATUS(childExitqStatus);
+ kdDebug(5100) << "GnuPG exited with exit status " << childExitqStatus
<< endl;
}
else {
- childExiStatus = -1;
+ childExitqStatus = -1;
kdDebug(5100) << "GnuPG exited abnormally!" << endl;
}
@@ -663,11 +663,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
// get to know what's going on during the gpg calls.
kdDebug(5100) << "gpg stderr:\n" << error << endl;
- return childExiStatus;
+ return childExitqStatus;
}
-QCString
+TQCString
Base::addUserId()
{
TQCString cmd;
diff --git a/libkpgp/kpgpbase.h b/libkpgp/kpgpbase.h
index aaa389eb8..14f849cc8 100644
--- a/libkpgp/kpgpbase.h
+++ b/libkpgp/kpgpbase.h
@@ -227,7 +227,7 @@ private:
// ---------------------------------------------------------------------------
// inlined functions
-inline QString
+inline TQString
Base::lastErrorMessage() const
{
return errMsg;
diff --git a/libkpgp/kpgpbase2.cpp b/libkpgp/kpgpbase2.cpp
index 06c0d1e60..da0038819 100644
--- a/libkpgp/kpgpbase2.cpp
+++ b/libkpgp/kpgpbase2.cpp
@@ -66,7 +66,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
const char *passphrase )
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
if(!recipients.isEmpty() && passphrase != 0)
cmd = PGP2 " +batchmode +language=en +verbose=1 -seat";
@@ -100,12 +100,12 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
clear();
input = block.text();
- exiStatus = run(cmd.data(), passphrase);
+ exitqStatus = run(cmd.data(), passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
- if(exiStatus != 0)
+ if(exitqStatus != 0)
status = ERROR;
#if 0
@@ -118,16 +118,16 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
bool bad = FALSE;
unsigned int num = 0;
TQCString badkeys = "";
- if (error.find("Cannot find the public key") != -1)
+ if (error.tqfind("Cannot find the public key") != -1)
{
index = 0;
num = 0;
- while((index = error.find("Cannot find the public key",index))
+ while((index = error.tqfind("Cannot find the public key",index))
!= -1)
{
bad = TRUE;
- index = error.find('\'',index);
- int index2 = error.find('\'',index+1);
+ index = error.tqfind('\'',index);
+ int index2 = error.tqfind('\'',index+1);
if (num++)
badkeys += ", ";
badkeys += error.mid(index, index2-index+1);
@@ -149,15 +149,15 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
status |= ERROR;
}
}
- if (error.find("skipping userid") != -1)
+ if (error.tqfind("skipping userid") != -1)
{
index = 0;
num = 0;
- while((index = error.find("skipping userid",index))
+ while((index = error.tqfind("skipping userid",index))
!= -1)
{
bad = TRUE;
- int index2 = error.find('\n',index+16);
+ int index2 = error.tqfind('\n',index+16);
if (num++)
badkeys += ", ";
badkeys += error.mid(index+16, index2-index-16);
@@ -187,12 +187,12 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
#endif
if(passphrase != 0)
{
- if(error.find("Pass phrase is good") != -1)
+ if(error.tqfind("Pass phrase is good") != -1)
{
//kdDebug(5100) << "Base: Good Passphrase!" << endl;
status |= SIGNED;
}
- if( error.find("Bad pass phrase") != -1)
+ if( error.tqfind("Bad pass phrase") != -1)
{
errMsg = i18n("Bad passphrase; could not sign.");
status |= BADPHRASE;
@@ -200,7 +200,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
status |= ERROR;
}
}
- if (error.find("Signature error") != -1)
+ if (error.tqfind("Signature error") != -1)
{
errMsg = i18n("Signing failed: please check your PGP User Identity, "
"the PGP setup, and the key rings.");
@@ -208,7 +208,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
status |= ERR_SIGNING;
status |= ERROR;
}
- if (error.find("Encryption error") != -1)
+ if (error.tqfind("Encryption error") != -1)
{
errMsg = i18n("Encryption failed: please check your PGP setup "
"and the key rings.");
@@ -218,7 +218,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients,
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -227,38 +227,38 @@ int
Base2::decrypt( Block& block, const char *passphrase )
{
int index, index2;
- int exiStatus = 0;
+ int exitqStatus = 0;
clear();
input = block.text();
- exiStatus = run(PGP2 " +batchmode +language=en -f", passphrase);
+ exitqStatus = run(PGP2 " +batchmode +language=en -f", passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
// pgp2.6 has sometimes problems with the ascii armor pgp5.0 produces
// this hack can solve parts of the problem
- if(error.find("ASCII armor corrupted.") != -1)
+ if(error.tqfind("ASCII armor corrupted.") != -1)
{
kdDebug(5100) << "removing ASCII armor header" << endl;
- int index1 = input.find("-----BEGIN PGP SIGNED MESSAGE-----");
+ int index1 = input.tqfind("-----BEGIN PGP SIGNED MESSAGE-----");
if(index1 != -1)
- index1 = input.find("-----BEGIN PGP SIGNATURE-----", index1);
+ index1 = input.tqfind("-----BEGIN PGP SIGNATURE-----", index1);
else
- index1 = input.find("-----BEGIN PGP MESSAGE-----");
- index1 = input.find('\n', index1);
- index2 = input.find("\n\n", index1);
+ index1 = input.tqfind("-----BEGIN PGP MESSAGE-----");
+ index1 = input.tqfind('\n', index1);
+ index2 = input.tqfind("\n\n", index1);
input.remove(index1, index2 - index1);
- exiStatus = run(PGP2 " +batchmode +language=en -f", passphrase);
+ exitqStatus = run(PGP2 " +batchmode +language=en -f", passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
}
- if(exiStatus == -1) {
+ if(exitqStatus == -1) {
errMsg = i18n("error running PGP");
status = RUN_ERR;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -282,19 +282,19 @@ Base2::decrypt( Block& block, const char *passphrase )
*
* You do not have the secret key needed to decrypt this file.
*/
- if(error.find("File is encrypted.") != -1)
+ if(error.tqfind("File is encrypted.") != -1)
{
//kdDebug(5100) << "kpgpbase: message is encrypted" << endl;
status |= ENCRYPTED;
- if((index = error.find("Key for user ID:")) != -1)
+ if((index = error.tqfind("Key for user ID:")) != -1)
{
// Find out the key for which the phrase is needed
index += 17;
- index2 = error.find('\n', index);
+ index2 = error.tqfind('\n', index);
block.setRequiredUserId( error.mid(index, index2 - index) );
//kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!\n";
- if((passphrase != 0) && (error.find("Bad pass phrase") != -1))
+ if((passphrase != 0) && (error.tqfind("Bad pass phrase") != -1))
{
errMsg = i18n("Bad passphrase; could not decrypt.");
kdDebug(5100) << "Base: passphrase is bad" << endl;
@@ -314,14 +314,14 @@ Base2::decrypt( Block& block, const char *passphrase )
#if 0
// ##### FIXME: This information is anyway currently not used
// I'll change it to always determine the recipients.
- index = error.find("can only be read by:");
+ index = error.tqfind("can only be read by:");
if(index != -1)
{
- index = error.find('\n',index);
- int end = error.find("\n\n",index);
+ index = error.tqfind('\n',index);
+ int end = error.tqfind("\n\n",index);
mRecipients.clear();
- while( (index2 = error.find('\n',index+1)) <= end )
+ while( (index2 = error.tqfind('\n',index+1)) <= end )
{
TQCString item = error.mid(index+1,index2-index-1);
item.stripWhiteSpace();
@@ -392,19 +392,19 @@ Base2::decrypt( Block& block, const char *passphrase )
* Signature made 2001/09/09 16:01 GMT using 1024-bit key, key ID 12345678
*/
- if((index = error.find("File has signature")) != -1)
+ if((index = error.tqfind("File has signature")) != -1)
{
// move index to start of next line
- index = error.find('\n', index+18) + 1;
+ index = error.tqfind('\n', index+18) + 1;
//kdDebug(5100) << "Base: message is signed" << endl;
status |= SIGNED;
// get signature date and signature key ID
- if ((index2 = error.find("Signature made", index)) != -1) {
+ if ((index2 = error.tqfind("Signature made", index)) != -1) {
index2 += 15;
- int index3 = error.find("using", index2);
+ int index3 = error.tqfind("using", index2);
block.setSignatureDate( error.mid(index2, index3-index2-1) );
kdDebug(5100) << "Message was signed on '" << block.signatureDate() << "'\n";
- index3 = error.find("key ID ", index3) + 7;
+ index3 = error.tqfind("key ID ", index3) + 7;
block.setSignatureKeyId( error.mid(index3,8) );
kdDebug(5100) << "Message was signed with key '" << block.signatureKeyId() << "'\n";
}
@@ -415,38 +415,38 @@ Base2::decrypt( Block& block, const char *passphrase )
block.setSignatureKeyId( "" );
}
- if( ( index2 = error.find("Key matching expected", index) ) != -1)
+ if( ( index2 = error.tqfind("Key matching expected", index) ) != -1)
{
status |= UNKNOWN_SIG;
status |= GOODSIG;
- int index3 = error.find("Key ID ", index2) + 7;
+ int index3 = error.tqfind("Key ID ", index2) + 7;
block.setSignatureKeyId( error.mid(index3,8) );
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
}
- else if( (index2 = error.find("Good signature from", index)) != -1 )
+ else if( (index2 = error.tqfind("Good signature from", index)) != -1 )
{
status |= GOODSIG;
// get signer
- index = error.find('"',index2+19);
- index2 = error.find('"', index+1);
+ index = error.tqfind('"',index2+19);
+ index2 = error.tqfind('"', index+1);
block.setSignatureUserId( error.mid(index+1, index2-index-1) );
}
- else if( (index2 = error.find("Bad signature from", index)) != -1 )
+ else if( (index2 = error.tqfind("Bad signature from", index)) != -1 )
{
status |= ERROR;
// get signer
- index = error.find('"',index2+19);
- index2 = error.find('"', index+1);
+ index = error.tqfind('"',index2+19);
+ index2 = error.tqfind('"', index+1);
block.setSignatureUserId( error.mid(index+1, index2-index-1) );
}
- else if( error.find("Keyring file", index) != -1 )
+ else if( error.tqfind("Keyring file", index) != -1 )
{
// #### fix this hack
status |= UNKNOWN_SIG;
status |= GOODSIG; // this is a hack...
// determine file name of missing keyring file
- index = error.find('\'', index) + 1;
- index2 = error.find('\'', index);
+ index = error.tqfind('\'', index) + 1;
+ index2 = error.tqfind('\'', index);
block.setSignatureUserId( i18n("The keyring file %1 does not exist.\n"
"Please check your PGP setup.").arg(error.mid(index, index2-index)) );
}
@@ -457,7 +457,7 @@ Base2::decrypt( Block& block, const char *passphrase )
}
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -467,13 +467,13 @@ Base2::readPublicKey( const KeyID& keyID,
const bool readTrust /* = false */,
Key* key /* = 0 */ )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
status = 0;
- exiStatus = run( PGP2 " +batchmode +language=en +verbose=0 -kvc -f 0x" +
+ exitqStatus = run( PGP2 " +batchmode +language=en +verbose=0 -kvc -f 0x" +
keyID, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -487,10 +487,10 @@ Base2::readPublicKey( const KeyID& keyID,
if( readTrust )
{
- exiStatus = run( PGP2 " +batchmode +language=en +verbose=0 -kc -f",
+ exitqStatus = run( PGP2 " +batchmode +language=en +verbose=0 -kc -f",
0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -512,14 +512,14 @@ Base2::publicKeys( const TQStringList & patterns )
KeyList
Base2::doGetPublicKeys( const TQCString & cmd, const TQStringList & patterns )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
KeyList publicKeys;
status = 0;
if ( patterns.isEmpty() ) {
- exiStatus = run( cmd, 0, true );
+ exitqStatus = run( cmd, 0, true );
- if ( exiStatus != 0 ) {
+ if ( exitqStatus != 0 ) {
status = ERROR;
return KeyList();
}
@@ -533,10 +533,10 @@ Base2::doGetPublicKeys( const TQCString & cmd, const TQStringList & patterns )
for ( TQStringList::ConstIterator it = patterns.begin();
it != patterns.end(); ++it ) {
- exiStatus = run( cmd + " " + KProcess::quote( *it ).local8Bit(),
+ exitqStatus = run( cmd + " " + KProcess::quote( *it ).local8Bit(),
0, true );
- if ( exiStatus != 0 ) {
+ if ( exitqStatus != 0 ) {
status = ERROR;
return KeyList();
}
@@ -576,16 +576,16 @@ int
Base2::signKey(const KeyID& keyID, const char *passphrase)
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
cmd = PGP2 " +batchmode +language=en -ks -f ";
cmd += addUserId();
cmd += " 0x" + keyID;
status = 0;
- exiStatus = run(cmd.data(),passphrase);
+ exitqStatus = run(cmd.data(),passphrase);
- if (exiStatus != 0)
+ if (exitqStatus != 0)
status = ERROR;
return status;
@@ -594,16 +594,16 @@ Base2::signKey(const KeyID& keyID, const char *passphrase)
TQCString Base2::getAsciiPublicKey(const KeyID& keyID)
{
- int exiStatus = 0;
+ int exitqStatus = 0;
if (keyID.isEmpty())
return TQCString();
status = 0;
- exiStatus = run( PGP2 " +batchmode +force +language=en -kxaf 0x" + keyID,
+ exitqStatus = run( PGP2 " +batchmode +force +language=en -kxaf 0x" + keyID,
0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return TQCString();
}
@@ -626,10 +626,10 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
{
/*
if( secretKeys )
- index = output.find( "\nsec" );
+ index = output.tqfind( "\nsec" );
else
*/
- index = output.find( "\npub" );
+ index = output.tqfind( "\npub" );
if( index == -1 )
return 0;
else
@@ -641,12 +641,12 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
int index2;
// search the end of the current line
- if( ( index2 = output.find( '\n', index ) ) == -1 )
+ if( ( index2 = output.tqfind( '\n', index ) ) == -1 )
break;
if( !strncmp( output.data() + index, "pub", 3 ) ||
!strncmp( output.data() + index, "sec", 3 ) )
- { // line tqcontains primary key data
+ { // line contains primary key data
// Example 1 (nothing special):
// pub 1024/E2D074D3 2001/09/09 Test Key <testkey@xyz>
// Example 2 (disabled key):
@@ -699,25 +699,25 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
pos = index + 4;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( '/', pos );
+ pos2 = output.tqfind( '/', pos );
subkey->setKeyLength( output.mid( pos, pos2-pos ).toUInt() );
// Key ID
pos = pos2 + 1;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyID( output.mid( pos, pos2-pos ) );
// Creation Date
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
int year = output.mid( pos, 4 ).toInt();
int month = output.mid( pos+5, 2 ).toInt();
int day = output.mid( pos+8, 2 ).toInt();
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
+ // The calculated creation date isn't exactly correct because TQDateTime
// 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
// the time this doesn't matter too much.
@@ -737,7 +737,7 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
}
}
else if( output[index] == ' ' )
- { // line tqcontains additional key data
+ { // line contains additional key data
if( key == 0 )
break;
@@ -748,20 +748,20 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
pos++;
if( !strncmp( output.data() + pos, "Key fingerprint = ", 18 ) )
- { // line tqcontains a fingerprint
+ { // line contains a fingerprint
// Example:
// Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49
TQCString fingerprint = output.mid( pos, index2-pos );
// remove white space from the fingerprint
- for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )
+ for ( int idx = 0 ; (idx = fingerprint.tqfind(' ', idx)) >= 0 ; )
fingerprint.tqreplace( idx, 1, "" );
subkey->setFingerprint( fingerprint );
}
else if( !strncmp( output.data() + pos, "Expire: ", 8 ) ||
!strncmp( output.data() + pos, "no expire ", 10 ) )
- { // line tqcontains additional key properties
+ { // line contains additional key properties
// Examples:
// Expire: 2001/09/10
// no expire ENCRyption only
@@ -801,7 +801,7 @@ Base2::parsePublicKeyData( const TQCString& output, Key* key /* = 0 */ )
}
}
else
- { // line tqcontains an additional user id
+ { // line contains an additional user id
// Example:
// Test key (2nd user ID) <abc@xyz>
@@ -827,10 +827,10 @@ Base2::parseTrustDataForKey( Key* key, const TQCString& str )
UserIDList userIDs = key->userIDs();
// search the trust data belonging to this key
- int index = str.find( '\n' ) + 1;
+ int index = str.tqfind( '\n' ) + 1;
while( ( index > 0 ) &&
( strncmp( str.data() + index+2, keyID.data(), 8 ) != 0 ) )
- index = str.find( '\n', index ) + 1;
+ index = str.tqfind( '\n', index ) + 1;
if( index == 0 )
return;
@@ -846,7 +846,7 @@ Base2::parseTrustDataForKey( Key* key, const TQCString& str )
int index2;
// search the end of the current line
- if( ( index2 = str.find( '\n', index ) ) == -1 )
+ if( ( index2 = str.tqfind( '\n', index ) ) == -1 )
break;
// check if trust info for the next key starts
@@ -854,7 +854,7 @@ Base2::parseTrustDataForKey( Key* key, const TQCString& str )
break;
if( str[index+21] != ' ' )
- { // line tqcontains a validity value for a user ID
+ { // line contains a validity value for a user ID
// determine the validity
Validity validity = KPGP_VALIDITY_UNKNOWN;
@@ -908,9 +908,9 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
else
{
if( secretKeys )
- index = output.find( "\nsec" );
+ index = output.tqfind( "\nsec" );
else
- index = output.find( "\npub" );
+ index = output.tqfind( "\npub" );
if( index == -1 )
return keys;
else
@@ -922,12 +922,12 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
int index2;
// search the end of the current line
- if( ( index2 = output.find( '\n', index ) ) == -1 )
+ if( ( index2 = output.tqfind( '\n', index ) ) == -1 )
break;
if( !strncmp( output.data() + index, "pub", 3 ) ||
!strncmp( output.data() + index, "sec", 3 ) )
- { // line tqcontains primary key data
+ { // line contains primary key data
// Example 1:
// pub 1024/E2D074D3 2001/09/09 Test Key <testkey@xyz>
// Example 2 (disabled key):
@@ -979,25 +979,25 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
pos = index + 4;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( '/', pos );
+ pos2 = output.tqfind( '/', pos );
subkey->setKeyLength( output.mid( pos, pos2-pos ).toUInt() );
// Key ID
pos = pos2 + 1;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyID( output.mid( pos, pos2-pos ) );
// Creation Date
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
int year = output.mid( pos, 4 ).toInt();
int month = output.mid( pos+5, 2 ).toInt();
int day = output.mid( pos+8, 2 ).toInt();
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
+ // The calculated creation date isn't exactly correct because TQDateTime
// 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
// the time this doesn't matter too much.
@@ -1017,7 +1017,7 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
}
}
else if( output[index] == ' ' )
- { // line tqcontains additional key data
+ { // line contains additional key data
if( key == 0 )
break;
@@ -1027,7 +1027,7 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
pos++;
if( !strncmp( output.data() + pos, "Key fingerprint = ", 18 ) )
- { // line tqcontains a fingerprint
+ { // line contains a fingerprint
// Example:
// Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49
@@ -1035,14 +1035,14 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
pos2 = pos + 18;
TQCString fingerprint = output.mid( pos, index2-pos );
// remove white space from the fingerprint
- for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )
+ for ( int idx = 0 ; (idx = fingerprint.tqfind(' ', idx)) >= 0 ; )
fingerprint.tqreplace( idx, 1, "" );
subkey->setFingerprint( fingerprint );
}
else if( !strncmp( output.data() + pos, "Expire: ", 8 ) ||
!strncmp( output.data() + pos, "no expire ", 10 ) )
- { // line tqcontains additional key properties
+ { // line contains additional key properties
// Examples:
// Expire: 2001/09/10
// no expire ENCRyption only
@@ -1082,7 +1082,7 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
}
}
else
- { // line tqcontains an additional user id
+ { // line contains an additional user id
// Example:
// Test key (2nd user ID) <abc@xyz>
diff --git a/libkpgp/kpgpbase5.cpp b/libkpgp/kpgpbase5.cpp
index a5988a9cb..d78998475 100644
--- a/libkpgp/kpgpbase5.cpp
+++ b/libkpgp/kpgpbase5.cpp
@@ -66,7 +66,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
const char *passphrase )
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
int index;
// used to work around a bug in pgp5. pgp5 treats files
// with non ascii chars (umlauts, etc...) as binary files, but
@@ -116,14 +116,14 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
}
//We have to do this otherwise it's all in vain
- exiStatus = run(cmd.data(), passphrase);
+ exitqStatus = run(cmd.data(), passphrase);
block.setError( error );
- if(exiStatus != 0)
+ if(exitqStatus != 0)
status = ERROR;
// now parse the returned info
- if(error.find("Cannot unlock private key") != -1)
+ if(error.tqfind("Cannot unlock private key") != -1)
{
errMsg = i18n("The passphrase you entered is invalid.");
status |= ERROR;
@@ -133,16 +133,16 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
//{
TQCString aStr;
index = -1;
- while((index = error.find("WARNING: The above key",index+1)) != -1)
+ while((index = error.tqfind("WARNING: The above key",index+1)) != -1)
{
- int index2 = error.find("But you previously",index);
- int index3 = error.find("WARNING: The above key",index+1);
+ int index2 = error.tqfind("But you previously",index);
+ int index3 = error.tqfind("WARNING: The above key",index+1);
if(index2 == -1 || (index2 > index3 && index3 != -1))
{
// the key wasn't valid, no encryption to this person
// extract the person
- index2 = error.find('\n',index);
- index3 = error.find('\n',index2+1);
+ index2 = error.tqfind('\n',index);
+ index3 = error.tqfind('\n',index2+1);
aStr += error.mid(index2+1, index3-index2-1);
aStr += ", ";
}
@@ -150,7 +150,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
if(!aStr.isEmpty())
{
aStr.truncate(aStr.length()-2);
- if(error.find("No valid keys found") != -1)
+ if(error.tqfind("No valid keys found") != -1)
errMsg = i18n("The key(s) you want to encrypt your message "
"to are not trusted. No encryption done.");
else
@@ -161,10 +161,10 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
status |= BADKEYS;
}
//}
- if((index = error.find("No encryption keys found for")) != -1)
+ if((index = error.tqfind("No encryption keys found for")) != -1)
{
- index = error.find(':',index);
- int index2 = error.find('\n',index);
+ index = error.tqfind(':',index);
+ int index2 = error.tqfind('\n',index);
errMsg = i18n("Missing encryption key(s) for:\n%1")
.arg(error.mid(index,index2-index));
@@ -178,14 +178,14 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
// dash-escape the input
if (input[0] == '-')
input = "- " + input;
- for ( int idx = 0 ; (idx = input.find("\n-", idx)) >= 0 ; idx += 4 )
+ for ( int idx = 0 ; (idx = input.tqfind("\n-", idx)) >= 0 ; idx += 4 )
input.tqreplace(idx, 2, "\n- -");
output = "-----BEGIN PGP SIGNED MESSAGE-----\n\n" + input + "\n" + output;
}
block.setProcessedText( output );
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -193,26 +193,26 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
int
Base5::decrypt( Block& block, const char *passphrase )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
clear();
input = block.text();
- exiStatus = run("pgpv -f +batchmode=1", passphrase);
+ exitqStatus = run("pgpv -f +batchmode=1", passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
- if(exiStatus == -1) {
+ if(exitqStatus == -1) {
errMsg = i18n("Error running PGP");
status = RUN_ERR;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
// lets parse the returned information.
int index;
- index = error.find("Cannot decrypt message");
+ index = error.tqfind("Cannot decrypt message");
if(index != -1)
{
//kdDebug(5100) << "message is encrypted" << endl;
@@ -220,7 +220,7 @@ Base5::decrypt( Block& block, const char *passphrase )
// ok. we have an encrypted message. Is the passphrase bad,
// or do we not have the secret key?
- if(error.find("Need a pass phrase") != -1)
+ if(error.tqfind("Need a pass phrase") != -1)
{
if(passphrase != 0)
{
@@ -242,15 +242,15 @@ Base5::decrypt( Block& block, const char *passphrase )
#if 0
// ##### FIXME: This information is anyway currently not used
// I'll change it to always determine the recipients.
- index = error.find("can only be decrypted by:");
+ index = error.tqfind("can only be decrypted by:");
if(index != -1)
{
- index = error.find('\n',index);
- int end = error.find("\n\n",index);
+ index = error.tqfind('\n',index);
+ int end = error.tqfind("\n\n",index);
mRecipients.clear();
int index2;
- while( (index2 = error.find('\n',index+1)) <= end )
+ while( (index2 = error.tqfind('\n',index+1)) <= end )
{
TQCString item = error.mid(index+1,index2-index-1);
item.stripWhiteSpace();
@@ -260,7 +260,7 @@ Base5::decrypt( Block& block, const char *passphrase )
}
#endif
}
- index = error.find("Good signature");
+ index = error.tqfind("Good signature");
if(index != -1)
{
//kdDebug(5100) << "good signature" << endl;
@@ -268,18 +268,18 @@ Base5::decrypt( Block& block, const char *passphrase )
status |= GOODSIG;
// get key ID of signer
- index = error.find("Key ID ", index) + 7;
+ index = error.tqfind("Key ID ", index) + 7;
block.setSignatureKeyId( error.mid(index, 8) );
// get signer
- index = error.find('"',index) + 1;
- int index2 = error.find('"', index);
+ index = error.tqfind('"',index) + 1;
+ int index2 = error.tqfind('"', index);
block.setSignatureUserId( error.mid(index, index2-index) );
/// ### FIXME get signature date
block.setSignatureDate( "" );
}
- index = error.find("BAD signature");
+ index = error.tqfind("BAD signature");
if(index != -1)
{
//kdDebug(5100) << "BAD signature" << endl;
@@ -287,23 +287,23 @@ Base5::decrypt( Block& block, const char *passphrase )
status |= ERROR;
// get key ID of signer
- index = error.find("Key ID ", index) + 7;
+ index = error.tqfind("Key ID ", index) + 7;
block.setSignatureKeyId( error.mid(index, 8) );
// get signer
- index = error.find('"',index) + 1;
- int index2 = error.find('"', index);
+ index = error.tqfind('"',index) + 1;
+ int index2 = error.tqfind('"', index);
block.setSignatureUserId( error.mid(index, index2-index) );
/// ### FIXME get signature date
block.setSignatureDate( "" );
}
- index = error.find("Signature by unknown key");
+ index = error.tqfind("Signature by unknown key");
if(index != -1)
{
- index = error.find("keyid: 0x",index) + 9;
+ index = error.tqfind("keyid: 0x",index) + 9;
block.setSignatureKeyId( error.mid(index, 8) );
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
// FIXME: not a very good solution...
status |= SIGNED;
status |= GOODSIG;
@@ -313,7 +313,7 @@ Base5::decrypt( Block& block, const char *passphrase )
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -321,12 +321,12 @@ Base5::decrypt( Block& block, const char *passphrase )
Key*
Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
status = 0;
- exiStatus = run( "pgpk -ll 0x" + keyId, 0, true );
+ exitqStatus = run( "pgpk -ll 0x" + keyId, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -340,9 +340,9 @@ Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
if( readTrust )
{
- exiStatus = run( "pgpk -c 0x" + keyId, 0, true );
+ exitqStatus = run( "pgpk -c 0x" + keyId, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -357,7 +357,7 @@ Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
KeyList
Base5::publicKeys( const TQStringList & patterns )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
TQCString cmd = "pgpk -ll";
for ( TQStringList::ConstIterator it = patterns.begin();
@@ -366,9 +366,9 @@ Base5::publicKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exiStatus = run( cmd, 0, true );
+ exitqStatus = run( cmd, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -386,7 +386,7 @@ Base5::publicKeys( const TQStringList & patterns )
KeyList
Base5::secretKeys( const TQStringList & patterns )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
status = 0;
TQCString cmd = "pgpk -ll";
@@ -396,9 +396,9 @@ Base5::secretKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exiStatus = run( cmd, 0, true );
+ exitqStatus = run( cmd, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -415,15 +415,15 @@ Base5::secretKeys( const TQStringList & patterns )
TQCString Base5::getAsciiPublicKey(const KeyID& keyID)
{
- int exiStatus = 0;
+ int exitqStatus = 0;
if (keyID.isEmpty())
return TQCString();
status = 0;
- exiStatus = run( "pgpk -xa 0x" + keyID, 0, true );
+ exitqStatus = run( "pgpk -xa 0x" + keyID, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return TQCString();
}
@@ -436,7 +436,7 @@ int
Base5::signKey(const KeyID& keyID, const char *passphrase)
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
if(passphrase == 0) return false;
@@ -445,9 +445,9 @@ Base5::signKey(const KeyID& keyID, const char *passphrase)
cmd += addUserId();
status = 0;
- exiStatus = run(cmd.data(), passphrase);
+ exitqStatus = run(cmd.data(), passphrase);
- if (exiStatus != 0)
+ if (exitqStatus != 0)
status = ERROR;
return status;
@@ -483,7 +483,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
int eol;
// search the end of the current line
- eol = output.find( '\n', offset );
+ eol = output.tqfind( '\n', offset );
if( ( eol == -1 ) || ( eol == offset ) )
break;
@@ -492,7 +492,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
if( !strncmp( output.data() + offset, "pub", 3 ) ||
!strncmp( output.data() + offset, "sec", 3 ) ||
!strncmp( output.data() + offset, "sub", 3 ) )
- { // line tqcontains key data
+ { // line contains key data
//kdDebug(5100)<<"Key data:\n";
int pos, pos2;
@@ -525,7 +525,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = offset + 4;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyLength( output.mid( pos, pos2-pos ).toUInt() );
//kdDebug(5100) << "Key Length: "<<subkey->keyLength()<<endl;
@@ -534,7 +534,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
while( output[pos] == ' ' )
pos++;
pos += 2; // skip the '0x'
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyID( output.mid( pos, pos2-pos ) );
//kdDebug(5100) << "Key ID: "<<subkey->keyID()<<endl;
@@ -542,13 +542,13 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
int year = output.mid( pos, 4 ).toInt();
int month = output.mid( pos+5, 2 ).toInt();
int day = output.mid( pos+8, 2 ).toInt();
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
+ // The calculated creation date isn't exactly correct because TQDateTime
// 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
// the time this doesn't matter too much.
@@ -561,7 +561,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
if( output[pos] == '-' )
{ // key doesn't expire
subkey->setExpirationDate( -1 );
@@ -595,7 +595,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
if( !strncmp( output.data() + pos, "RSA", 3 ) )
{
sign = true;
@@ -647,23 +647,23 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
}
else if( !strncmp( output.data() + offset, "f16", 3 ) ||
!strncmp( output.data() + offset, "f20", 3 ) )
- { // line tqcontains a fingerprint
+ { // line contains a fingerprint
/* Examples:
f16 Fingerprint16 = DE 2A 77 08 78 64 7C 42 72 75 B1 A7 3E 42 3F 79
f20 Fingerprint20 = 226F 4B63 6DA2 7389 91D1 2A49 D58A 3EC1 5214 181E
*/
- int pos = output.find( '=', offset+3 ) + 2;
+ int pos = output.tqfind( '=', offset+3 ) + 2;
TQCString fingerprint = output.mid( pos, eol-pos );
// remove white space from the fingerprint
- for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )
+ for ( int idx = 0 ; (idx = fingerprint.tqfind(' ', idx)) >= 0 ; )
fingerprint.tqreplace( idx, 1, "" );
assert( subkey != 0 );
subkey->setFingerprint( fingerprint );
//kdDebug(5100)<<"Fingerprint: "<<fingerprint<<endl;
}
else if( !strncmp( output.data() + offset, "uid", 3 ) )
- { // line tqcontains a uid
+ { // line contains a uid
int pos = offset+5;
TQCString uid = output.mid( pos, eol-pos );
key->addUserID( uid );
@@ -678,7 +678,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
else if ( !strncmp( output.data() + offset, "sig", 3 ) ||
!strncmp( output.data() + offset, "SIG", 3 ) ||
!strncmp( output.data() + offset, "ret", 3 ) )
- { // line tqcontains a signature
+ { // line contains a signature
// SIG = sig with own key; ret = sig with revoked key
// we ignore it for now
}
@@ -700,13 +700,13 @@ Base5::parseSingleKey( const TQCString& output, Key* key /* = 0 */ )
offset = 0;
else
{
- offset = output.find( "\nType Bits" ) + 1;
+ offset = output.tqfind( "\nType Bits" ) + 1;
if( offset == 0 )
return 0;
}
// key data begins in the next line
- offset = output.find( '\n', offset ) + 1;
+ offset = output.tqfind( '\n', offset ) + 1;
if( offset == -1 )
return 0;
@@ -730,13 +730,13 @@ Base5::parseKeyList( const TQCString& output, bool onlySecretKeys )
offset = 0;
else
{
- offset = output.find( "\nType Bits" ) + 1;
+ offset = output.tqfind( "\nType Bits" ) + 1;
if( offset == 0 )
return keys;
}
// key data begins in the next line
- offset = output.find( '\n', offset ) + 1;
+ offset = output.tqfind( '\n', offset ) + 1;
if( offset == -1 )
return keys;
@@ -770,11 +770,11 @@ Base5::parseTrustDataForKey( Key* key, const TQCString& str )
UserIDList userIDs = key->userIDs();
// search the start of the trust data
- int offset = str.find( "\n\n KeyID" ) + 9;
+ int offset = str.tqfind( "\n\n KeyID" ) + 9;
if( offset == -1 + 9 )
return;
- offset = str.find( '\n', offset ) + 1;
+ offset = str.tqfind( '\n', offset ) + 1;
if( offset == -1 + 1 )
return;
@@ -788,11 +788,11 @@ Base5::parseTrustDataForKey( Key* key, const TQCString& str )
int eol;
// search the end of the current line
- if( ( eol = str.find( '\n', offset ) ) == -1 )
+ if( ( eol = str.tqfind( '\n', offset ) ) == -1 )
break;
if( str[offset+23] != ' ' )
- { // line tqcontains a validity value for a user ID
+ { // line contains a validity value for a user ID
// determine the validity
Validity validity = KPGP_VALIDITY_UNKNOWN;
diff --git a/libkpgp/kpgpbase6.cpp b/libkpgp/kpgpbase6.cpp
index fba6d4ec7..440ac6e20 100644
--- a/libkpgp/kpgpbase6.cpp
+++ b/libkpgp/kpgpbase6.cpp
@@ -49,32 +49,32 @@ int
Base6::decrypt( Block& block, const char *passphrase )
{
int index, index2;
- int exiStatus = 0;
+ int exitqStatus = 0;
clear();
input = block.text();
- exiStatus = run( PGP6 " +batchmode +language=C -f", passphrase);
+ exitqStatus = run( PGP6 " +batchmode +language=C -f", passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
- if(exiStatus == -1) {
+ if(exitqStatus == -1) {
errMsg = i18n("error running PGP");
status = RUN_ERR;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
// encrypted message
- if( error.find("File is encrypted.") != -1)
+ if( error.tqfind("File is encrypted.") != -1)
{
//kdDebug(5100) << "kpgpbase: message is encrypted" << endl;
status |= ENCRYPTED;
- if((index = error.find("Key for user ID")) != -1)
+ if((index = error.tqfind("Key for user ID")) != -1)
{
// Find out the key for which the phrase is needed
- index = error.find(':', index) + 2;
- index2 = error.find('\n', index);
+ index = error.tqfind(':', index) + 2;
+ index2 = error.tqfind('\n', index);
block.setRequiredUserId( error.mid(index, index2 - index) );
//kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!\n";
@@ -90,7 +90,7 @@ Base6::decrypt( Block& block, const char *passphrase )
status |= ERROR;
}
}
- else if( error.find("You do not have the secret key needed to decrypt this file.") != -1)
+ else if( error.tqfind("You do not have the secret key needed to decrypt this file.") != -1)
{
errMsg = i18n("You do not have the secret key for this message.");
//kdDebug(5100) << "Base: no secret key for this message" << endl;
@@ -123,46 +123,46 @@ Base6::decrypt( Block& block, const char *passphrase )
* File is signed. Good signature from user "Joe User <joe@foo.bar>".
* Signature made 2001/12/05 13:09 GMT
*/
- if(((index = error.find("File is signed.")) != -1)
- || (error.find("Good signature") != -1 ))
+ if(((index = error.tqfind("File is signed.")) != -1)
+ || (error.tqfind("Good signature") != -1 ))
{
//kdDebug(5100) << "Base: message is signed" << endl;
status |= SIGNED;
// determine the signature date
- if( ( index2 = error.find( "Signature made", index ) ) != -1 )
+ if( ( index2 = error.tqfind( "Signature made", index ) ) != -1 )
{
index2 += 15;
- int eol = error.find( '\n', index2 );
+ int eol = error.tqfind( '\n', index2 );
block.setSignatureDate( error.mid( index2, eol-index2 ) );
kdDebug(5100) << "Message was signed on '" << block.signatureDate() << "'\n";
}
else
block.setSignatureDate( TQCString() );
// determine signature status and signature key
- if( error.find("signature not checked") != -1)
+ if( error.tqfind("signature not checked") != -1)
{
- index = error.find("KeyID:",index);
+ index = error.tqfind("KeyID:",index);
block.setSignatureKeyId( error.mid(index+9,8) );
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
status |= UNKNOWN_SIG;
status |= GOODSIG;
}
- else if((index = error.find("Good signature")) != -1 )
+ else if((index = error.tqfind("Good signature")) != -1 )
{
status |= GOODSIG;
// get signer
- index = error.find('"',index)+1;
- index2 = error.find('"', index);
+ index = error.tqfind('"',index)+1;
+ index2 = error.tqfind('"', index);
block.setSignatureUserId( error.mid(index, index2-index) );
// get key ID of signer
- index = error.find("KeyID:",index2);
+ index = error.tqfind("KeyID:",index2);
if (index == -1)
block.setSignatureKeyId( TQCString() );
else
block.setSignatureKeyId( error.mid(index+9,8) );
}
- else if( error.find("Can't find the right public key") != -1 )
+ else if( error.tqfind("Can't find the right public key") != -1 )
{
// #### fix this hack
// #### This doesn't happen with PGP 6.5.8 because it seems to
@@ -175,12 +175,12 @@ Base6::decrypt( Block& block, const char *passphrase )
else
{
status |= ERROR;
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
block.setSignatureKeyId( TQCString() );
}
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -190,13 +190,13 @@ Base6::readPublicKey( const KeyID& keyID,
const bool readTrust /* = false */,
Key* key /* = 0 */ )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
status = 0;
- exiStatus = run( PGP6 " +batchmode -compatible +verbose=0 +language=C -kvvc "
+ exitqStatus = run( PGP6 " +batchmode -compatible +verbose=0 +language=C -kvvc "
"0x" + keyID, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -210,10 +210,10 @@ Base6::readPublicKey( const KeyID& keyID,
if( readTrust )
{
- exiStatus = run( PGP6 " +batchmode -compatible +verbose=0 +language=C -kc "
+ exitqStatus = run( PGP6 " +batchmode -compatible +verbose=0 +language=C -kc "
"0x" + keyID, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -234,17 +234,17 @@ Base6::publicKeys( const TQStringList & patterns )
/*
-QStrList
+TQStrList
Base6::pubKeys()
{
int index, index2;
- int exiStatus = 0;
+ int exitqStatus = 0;
int compatibleMode = 1;
status = 0;
- exiStatus = run("pgp +batchmode +language=C -kv -f");
+ exitqStatus = run("pgp +batchmode +language=C -kv -f");
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -253,28 +253,28 @@ Base6::pubKeys()
if (error.length() > 1) error.truncate(error.length()-1);
TQStrList publicKeys;
- index = error.find("bits/keyID",1); // skip first to "\n"
+ index = error.tqfind("bits/keyID",1); // skip first to "\n"
if (index ==-1)
{
- index = error.find("Type bits",1); // skip first to "\n"
+ index = error.tqfind("Type bits",1); // skip first to "\n"
if (index == -1)
return 0;
else
compatibleMode = 0;
}
- while( (index = error.find("\n",index)) != -1)
+ while( (index = error.tqfind("\n",index)) != -1)
{
//parse line
TQCString line;
- if( (index2 = error.find("\n",index+1)) != -1)
+ if( (index2 = error.tqfind("\n",index+1)) != -1)
// skip last line
{
int index3;
if (compatibleMode)
{
- int index_pub = error.find("pub ",index);
- int index_sec = error.find("sec ",index);
+ int index_pub = error.tqfind("pub ",index);
+ int index_sec = error.tqfind("sec ",index);
if (index_pub < 0)
index3 = index_sec;
else if (index_sec < 0)
@@ -284,8 +284,8 @@ Base6::pubKeys()
}
else
{
- int index_rsa = error.find("RSA ",index);
- int index_dss = error.find("DSS ",index);
+ int index_rsa = error.tqfind("RSA ",index);
+ int index_dss = error.tqfind("DSS ",index);
if (index_rsa < 0)
index3 = index_dss;
else if (index_dss < 0)
@@ -301,14 +301,14 @@ Base6::pubKeys()
line = line.stripWhiteSpace();
} else {
// line with new key
- int index4 = error.find(TQRegExp("/\\d{2}/\\d{2} "), index);
+ int index4 = error.tqfind(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(TQRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 &&
+ line.tqfind(TQRegExp("^expires \\d{4}/\\d{2}/\\d{2}")) < 0 &&
strncmp(line.data(),"*** DEFAULT SIGNING KEY ***",27)) {
publicKeys.append(line);
}
@@ -319,18 +319,18 @@ Base6::pubKeys()
}
// Also look for pgp key groups
- exiStatus = run("pgp +batchmode +language=C -gv -f");
+ exitqStatus = run("pgp +batchmode +language=C -gv -f");
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
index = 0;
- while ( (index = error.find("\n >", index)) != -1 ) {
+ while ( (index = error.tqfind("\n >", index)) != -1 ) {
TQCString line;
index += 4;
- index2 = error.find(" \"", index);
+ index2 = error.tqfind(" \"", index);
line = error.mid(index, index2-index+1).stripWhiteSpace();
//kdDebug(5100) << "Base6: found key group for " << line << endl;
@@ -352,17 +352,17 @@ Base6::secretKeys( const TQStringList & patterns )
int
Base6::isVersion6()
{
- int exiStatus = 0;
+ int exitqStatus = 0;
- exiStatus = run( PGP6, 0, true );
+ exitqStatus = run( PGP6, 0, true );
- if(exiStatus == -1) {
+ if(exitqStatus == -1) {
errMsg = i18n("error running PGP");
status = RUN_ERR;
return 0;
}
- if( error.find("Version 6") != -1)
+ if( error.tqfind("Version 6") != -1)
{
//kdDebug(5100) << "kpgpbase: pgp version 6.x detected" << endl;
return 1;
@@ -399,14 +399,14 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
int eol;
// search the end of the current line
- if( ( eol = output.find( '\n', offset ) ) == -1 )
+ if( ( eol = output.tqfind( '\n', offset ) ) == -1 )
break;
//kdDebug(5100) << "Parsing: " << output.mid(offset, eol-offset) << endl;
if( firstLine && ( !strncmp( output.data() + offset, "DSS", 3 ) ||
!strncmp( output.data() + offset, "RSA", 3 ) ) )
- { // line tqcontains primary key data
+ { // line contains primary key data
// Example 1:
// RSA 1024 0xE2D074D3 2001/09/09 Test Key <testkey@xyz>
// Example 2 (disabled key):
@@ -465,7 +465,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = offset + 4;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyLength( output.mid( pos, pos2-pos ).toUInt() );
//kdDebug(5100) << "Key Length: "<<subkey->keyLength()<<endl;
@@ -474,7 +474,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
while( output[pos] == ' ' )
pos++;
pos += 2; // skip the '0x'
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
subkey->setKeyID( output.mid( pos, pos2-pos ) );
//kdDebug(5100) << "Key ID: "<<subkey->keyID()<<endl;
@@ -482,13 +482,13 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
int year = output.mid( pos, 4 ).toInt();
int month = output.mid( pos+5, 2 ).toInt();
int day = output.mid( pos+8, 2 ).toInt();
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
+ // The calculated creation date isn't exactly correct because TQDateTime
// 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
// the time this doesn't matter too much.
@@ -554,7 +554,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
else if( !strncmp( output.data() + offset, "DSS", 3 ) ||
!strncmp( output.data() + offset, " DH", 3 ) ||
!strncmp( output.data() + offset, "RSA", 3 ) )
- { // line tqcontains secondary key data (or data for the next key)
+ { // line contains secondary key data (or data for the next key)
if( fpr )
break; // here begins the next key's data
//kdDebug(5100)<<"Secondary key data:\n";
@@ -582,19 +582,19 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos = offset + 4;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
// Key ID (ignored as it is anyway equal to the primary key id)
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
// Creation Date of secondary key (ignored)
pos = pos2 + 1;
while( output[pos] == ' ' )
pos++;
- pos2 = output.find( ' ', pos );
+ pos2 = output.tqfind( ' ', pos );
// User ID or key properties
pos = pos2 + 1;
@@ -639,11 +639,11 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
canEncr = canEncr || encr;
}
else if( !strncmp( output.data() + offset, "Unknown type", 12 ) )
- { // line tqcontains key data of unknown type (ignored)
+ { // line contains key data of unknown type (ignored)
kdDebug(5100)<<"Unknown key type.\n";
}
else if( output[offset] == ' ' )
- { // line tqcontains additional key data
+ { // line contains additional key data
if( key == 0 )
break;
//kdDebug(5100)<<"Additional key data:\n";
@@ -653,7 +653,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos++;
if( !strncmp( output.data() + pos, "Key fingerprint = ", 18 ) )
- { // line tqcontains a fingerprint
+ { // line contains a fingerprint
// Example:
// Key fingerprint = D0 6C BB 3A F5 16 82 C4 F3 A0 8A B3 7B 16 99 70
@@ -662,7 +662,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
pos += 18;
TQCString fingerprint = output.mid( pos, eol-pos );
// remove white space from the fingerprint
- for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )
+ for ( int idx = 0 ; (idx = fingerprint.tqfind(' ', idx)) >= 0 ; )
fingerprint.tqreplace( idx, 1, "" );
//kdDebug(5100)<<"Fingerprint: "<<fingerprint<<endl;
@@ -670,7 +670,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
subkey->setFingerprint( fingerprint );
}
else
- { // line tqcontains an additional user id
+ { // line contains an additional user id
// Example:
// Test key (2nd user ID) <abc@xyz>
@@ -679,7 +679,7 @@ Base6::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
}
}
else if( !strncmp( output.data() + offset, "sig", 3 ) )
- { // line tqcontains signature data (ignored)
+ { // line contains signature data (ignored)
//kdDebug(5100)<<"Signature.\n";
}
else // end of key data
@@ -712,7 +712,7 @@ Base6::parseSingleKey( const TQCString& output, Key* key /* = 0 */ )
offset = 9;
else
{
- offset = output.find( "\nType bits" );
+ offset = output.tqfind( "\nType bits" );
if( offset == -1 )
return 0;
else
@@ -720,7 +720,7 @@ Base6::parseSingleKey( const TQCString& output, Key* key /* = 0 */ )
}
// key data begins in the next line
- offset = output.find( '\n', offset ) + 1;
+ offset = output.tqfind( '\n', offset ) + 1;
if( offset == 0 )
return 0;
@@ -745,13 +745,13 @@ Base6::parseKeyList( const TQCString& output, bool secretKeys )
offset = 0;
else
{
- offset = output.find( "\nType bits" ) + 1;
+ offset = output.tqfind( "\nType bits" ) + 1;
if( offset == 0 )
return keys;
}
// key data begins in the next line
- offset = output.find( '\n', offset ) + 1;
+ offset = output.tqfind( '\n', offset ) + 1;
if( offset == -1 )
return keys;
@@ -782,11 +782,11 @@ Base6::parseTrustDataForKey( Key* key, const TQCString& str )
UserIDList userIDs = key->userIDs();
// search the start of the trust data
- int offset = str.find( "\n\n KeyID" );
+ int offset = str.tqfind( "\n\n KeyID" );
if( offset == -1 )
return;
- offset = str.find( '\n', offset ) + 1;
+ offset = str.tqfind( '\n', offset ) + 1;
if( offset == 0 )
return;
@@ -800,11 +800,11 @@ Base6::parseTrustDataForKey( Key* key, const TQCString& str )
int eol;
// search the end of the current line
- if( ( eol = str.find( '\n', offset ) ) == -1 )
+ if( ( eol = str.tqfind( '\n', offset ) ) == -1 )
break;
if( str[offset+23] != ' ' )
- { // line tqcontains a validity value for a user ID
+ { // line contains a validity value for a user ID
// determine the validity
Validity validity = KPGP_VALIDITY_UNKNOWN;
diff --git a/libkpgp/kpgpbaseG.cpp b/libkpgp/kpgpbaseG.cpp
index 5aa619ec6..d9adb11a2 100644
--- a/libkpgp/kpgpbaseG.cpp
+++ b/libkpgp/kpgpbaseG.cpp
@@ -38,7 +38,7 @@ BaseG::BaseG()
{
// determine the version of gpg (the method is equivalent to gpgme's method)
runGpg( "--version", 0 );
- int eol = output.find( '\n' );
+ int eol = output.tqfind( '\n' );
if( eol > 0 ) {
int pos = output.findRev( ' ', eol - 1 );
if( pos != -1 ) {
@@ -73,7 +73,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients,
const char *passphrase )
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
if(!recipients.isEmpty() && passphrase != 0)
cmd = "--batch --armor --sign --encrypt --textmode";
@@ -109,12 +109,12 @@ BaseG::encsign( Block& block, const KeyIDList& recipients,
clear();
input = block.text();
- exiStatus = runGpg(cmd.data(), passphrase);
+ exitqStatus = runGpg(cmd.data(), passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
- if( exiStatus != 0 )
+ if( exitqStatus != 0 )
{
// this error message is later hopefully overwritten
errMsg = i18n( "Unknown error." );
@@ -138,11 +138,11 @@ BaseG::encsign( Block& block, const KeyIDList& recipients,
// (expired or revoked key)
// gpg: 23456789: no info to calculate a trust probability
// (untrusted key, 23456789 is the key Id of the encryption sub key)
- while((index = error.find("skipped: ",index)) != -1)
+ while((index = error.tqfind("skipped: ",index)) != -1)
{
bad = TRUE;
- index = error.find('\'',index);
- int index2 = error.find('\'',index+1);
+ index = error.tqfind('\'',index);
+ int index2 = error.tqfind('\'',index+1);
badkeys += error.mid(index, index2-index+1) + ", ";
num++;
}
@@ -178,14 +178,14 @@ BaseG::encsign( Block& block, const KeyIDList& recipients,
// Example 4 (unusable secret key, sign & encrypt):
// gpg: skipped `0xAC0EB35D': unusable secret key
// gpg: [stdin]: sign+encrypt failed: unusable secret key
- if( error.find("bad passphrase") != -1 )
+ if( error.tqfind("bad passphrase") != -1 )
{
errMsg = i18n("Signing failed because the passphrase is wrong.");
status |= BADPHRASE;
status |= ERR_SIGNING;
status |= ERROR;
}
- else if( error.find("unusable secret key") != -1 )
+ else if( error.tqfind("unusable secret key") != -1 )
{
errMsg = i18n("Signing failed because your secret key is unusable.");
status |= ERR_SIGNING;
@@ -199,7 +199,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients,
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -208,19 +208,19 @@ int
BaseG::decrypt( Block& block, const char *passphrase )
{
int index, index2;
- int exiStatus = 0;
+ int exitqStatus = 0;
clear();
input = block.text();
- exiStatus = runGpg("--batch --decrypt", passphrase);
- if( !output.isEmpty() && ( error.find( "gpg: quoted printable" ) == -1 ) )
+ exitqStatus = runGpg("--batch --decrypt", passphrase);
+ if( !output.isEmpty() && ( error.tqfind( "gpg: quoted printable" ) == -1 ) )
block.setProcessedText( output );
block.setError( error );
- if(exiStatus == -1) {
+ if(exitqStatus == -1) {
errMsg = i18n("Error running gpg");
status = RUN_ERR;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -244,13 +244,13 @@ BaseG::decrypt( Block& block, const char *passphrase )
// gpg: public key decryption failed: bad passphrase
// gpg: encrypted with 2048-bit ELG-E key, ID 23456789, created 2000-02-02
// "Foo Bar (home) <foo@bar.xyz>"
- if( error.find( "gpg: encrypted with" ) != -1 )
+ if( error.tqfind( "gpg: encrypted with" ) != -1 )
{
//kdDebug(5100) << "kpgpbase: message is encrypted" << endl;
status |= ENCRYPTED;
- if( error.find( "\ngpg: decryption failed" ) != -1 )
+ if( error.tqfind( "\ngpg: decryption failed" ) != -1 )
{
- if( ( index = error.find( "bad passphrase" ) ) != -1 )
+ if( ( index = error.tqfind( "bad passphrase" ) ) != -1 )
{
if( passphrase != 0 )
{
@@ -270,7 +270,7 @@ BaseG::decrypt( Block& block, const char *passphrase )
kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!" << endl;
}
}
- else if( error.find( "secret key not available" ) != -1 )
+ else if( error.tqfind( "secret key not available" ) != -1 )
{
// no secret key fitting this message
status |= NO_SEC_KEY;
@@ -283,14 +283,14 @@ BaseG::decrypt( Block& block, const char *passphrase )
#if 0
// ##### FIXME: This information is anyway currently not used
// I'll change it to always determine the recipients.
- index = error.find("can only be read by:");
+ index = error.tqfind("can only be read by:");
if(index != -1)
{
- index = error.find('\n',index);
- int end = error.find("\n\n",index);
+ index = error.tqfind('\n',index);
+ int end = error.tqfind("\n\n",index);
mRecipients.clear();
- while( (index2 = error.find('\n',index+1)) <= end )
+ while( (index2 = error.tqfind('\n',index+1)) <= end )
{
TQCString item = error.mid(index+1,index2-index-1);
item.stripWhiteSpace();
@@ -304,48 +304,48 @@ BaseG::decrypt( Block& block, const char *passphrase )
// Example 1 (unknown signature key):
// gpg: Signature made Wed 02 Jan 2002 11:26:33 AM CET using DSA key ID 2E250C64
// gpg: Can't check signature: public key not found
- if((index = error.find("Signature made")) != -1)
+ if((index = error.tqfind("Signature made")) != -1)
{
//kdDebug(5100) << "Base: message is signed" << endl;
status |= SIGNED;
// get signature date and signature key ID
// Example: Signature made Sun 06 May 2001 03:49:27 PM CEST using DSA key ID 12345678
- index2 = error.find("using", index+15);
+ index2 = error.tqfind("using", index+15);
block.setSignatureDate( error.mid(index+15, index2-(index+15)-1) );
kdDebug(5100) << "Message was signed on '" << block.signatureDate() << "'\n";
- index2 = error.find("key ID ", index2) + 7;
+ index2 = error.tqfind("key ID ", index2) + 7;
block.setSignatureKeyId( error.mid(index2,8) );
kdDebug(5100) << "Message was signed with key '" << block.signatureKeyId() << "'\n";
// move index to start of next line
- index = error.find('\n', index2)+1;
+ index = error.tqfind('\n', index2)+1;
- if ((error.find("Key matching expected", index) != -1)
- || (error.find("Can't check signature", index) != -1))
+ if ((error.tqfind("Key matching expected", index) != -1)
+ || (error.tqfind("Can't check signature", index) != -1))
{
status |= UNKNOWN_SIG;
status |= GOODSIG;
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
}
- else if( error.find("Good signature", index) != -1 )
+ else if( error.tqfind("Good signature", index) != -1 )
{
status |= GOODSIG;
// get the primary user ID of the signer
- index = error.find('"',index);
- index2 = error.find('\n',index+1);
+ index = error.tqfind('"',index);
+ index2 = error.tqfind('\n',index+1);
index2 = error.findRev('"', index2-1);
block.setSignatureUserId( error.mid( index+1, index2-index-1 ) );
}
- else if( error.find("BAD signature", index) != -1 )
+ else if( error.tqfind("BAD signature", index) != -1 )
{
//kdDebug(5100) << "BAD signature" << endl;
status |= ERROR;
// get the primary user ID of the signer
- index = error.find('"',index);
- index2 = error.find('\n',index+1);
+ index = error.tqfind('"',index);
+ index2 = error.tqfind('\n',index+1);
index2 = error.findRev('"', index2-1);
block.setSignatureUserId( error.mid( index+1, index2-index-1 ) );
}
- else if( error.find("Can't find the right public key", index) != -1 )
+ else if( error.tqfind("Can't find the right public key", index) != -1 )
{
// #### fix this hack
// I think this can't happen anymore because if the pubring is missing
@@ -357,11 +357,11 @@ BaseG::decrypt( Block& block, const char *passphrase )
else
{
status |= ERROR;
- block.setSignatureUserId( TQString::null );
+ block.setSignatureUserId( TQString() );
}
}
//kdDebug(5100) << "status = " << status << endl;
- block.seStatus( status );
+ block.setqStatus( status );
return status;
}
@@ -371,15 +371,15 @@ BaseG::readPublicKey( const KeyID& keyID,
const bool readTrust /* = false */,
Key* key /* = 0 */ )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
status = 0;
if( readTrust )
- exiStatus = runGpg( "--batch --list-public-keys --with-fingerprint --with-colons --fixed-list-mode 0x" + keyID, 0, true );
+ exitqStatus = runGpg( "--batch --list-public-keys --with-fingerprint --with-colons --fixed-list-mode 0x" + keyID, 0, true );
else
- exiStatus = runGpg( "--batch --list-public-keys --with-fingerprint --with-colons --fixed-list-mode --no-expensive-trust-checks 0x" + keyID, 0, true );
+ exitqStatus = runGpg( "--batch --list-public-keys --with-fingerprint --with-colons --fixed-list-mode --no-expensive-trust-checks 0x" + keyID, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return 0;
}
@@ -389,7 +389,7 @@ BaseG::readPublicKey( const KeyID& keyID,
if( !strncmp( output.data(), "pub:", 4 ) )
offset = 0;
else {
- offset = output.find( "\npub:" );
+ offset = output.tqfind( "\npub:" );
if( offset == -1 )
return 0;
else
@@ -405,7 +405,7 @@ BaseG::readPublicKey( const KeyID& keyID,
KeyList
BaseG::publicKeys( const TQStringList & patterns )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
// the option --with-colons should be used for interprocess communication
// with gpg (according to Werner Koch)
@@ -417,9 +417,9 @@ BaseG::publicKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exiStatus = runGpg( cmd, 0, true );
+ exitqStatus = runGpg( cmd, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -437,7 +437,7 @@ BaseG::publicKeys( const TQStringList & patterns )
KeyList
BaseG::secretKeys( const TQStringList & patterns )
{
- int exiStatus = 0;
+ int exitqStatus = 0;
// the option --with-colons should be used for interprocess communication
// with gpg (according to Werner Koch)
@@ -449,9 +449,9 @@ BaseG::secretKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exiStatus = runGpg( cmd, 0, true );
+ exitqStatus = runGpg( cmd, 0, true );
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -470,7 +470,7 @@ int
BaseG::signKey(const KeyID& keyID, const char *passphrase)
{
TQCString cmd;
- int exiStatus = 0;
+ int exitqStatus = 0;
cmd = "--batch";
cmd += addUserId();
@@ -478,27 +478,27 @@ BaseG::signKey(const KeyID& keyID, const char *passphrase)
cmd += keyID;
status = 0;
- exiStatus = runGpg(cmd.data(), passphrase);
+ exitqStatus = runGpg(cmd.data(), passphrase);
- if (exiStatus != 0)
+ if (exitqStatus != 0)
status = ERROR;
return status;
}
-QCString
+TQCString
BaseG::getAsciiPublicKey(const KeyID& keyID)
{
- int exiStatus = 0;
+ int exitqStatus = 0;
if (keyID.isEmpty())
return TQCString();
status = 0;
- exiStatus = runGpg("--batch --armor --export 0x" + keyID, 0, true);
+ exitqStatus = runGpg("--batch --armor --export 0x" + keyID, 0, true);
- if(exiStatus != 0) {
+ if(exitqStatus != 0) {
status = ERROR;
return TQCString();
}
@@ -536,13 +536,13 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
{
int eol;
// search the end of the current line
- if( ( eol = output.find( '\n', index ) ) == -1 )
+ if( ( eol = output.tqfind( '\n', index ) ) == -1 )
break;
bool bIsPublicKey = false;
if( ( bIsPublicKey = !strncmp( output.data() + index, "pub:", 4 ) )
|| !strncmp( output.data() + index, "sec:", 4 ) )
- { // line tqcontains primary key data
+ { // line contains primary key data
// Example: pub:f:1024:17:63CB691DFAEBD5FC:860451781::379:-:::scESC:
// abort parsing if we found the start of the next key
@@ -555,7 +555,7 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
Subkey *subkey = new Subkey( TQCString(), !bIsPublicKey );
int pos = index + 4; // begin of 2nd field
- int pos2 = output.find( ':', pos );
+ int pos2 = output.tqfind( ':', pos );
for( int field = 2; field <= 12; field++ )
{
switch( field )
@@ -652,18 +652,18 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
break;
}
pos = pos2 + 1;
- pos2 = output.find( ':', pos );
+ pos2 = output.tqfind( ':', pos );
}
key->addSubkey( subkey );
}
else if( !strncmp( output.data() + index, "uid:", 4 ) )
- { // line tqcontains a user id
+ { // line contains a user id
// Example: uid:f::::::::Philip R. Zimmermann <prz@pgp.com>:
UserID *userID = new UserID( "" );
int pos = index + 4; // begin of 2nd field
- int pos2 = output.find( ':', pos );
+ int pos2 = output.tqfind( ':', pos );
for( int field=2; field <= 10; field++ )
{
switch( field )
@@ -713,7 +713,7 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
// tqreplace "\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 ) {
+ for ( int idx = 0 ; (idx = uid.tqfind( "\\x", idx )) >= 0 ; ++idx ) {
char str[2] = "x";
str[0] = (char) TQString( uid.mid( idx + 2, 2 ) ).toShort( 0, 16 );
uid.tqreplace( idx, 4, str );
@@ -785,14 +785,14 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
break;
}
pos = pos2 + 1;
- pos2 = output.find( ':', pos );
+ pos2 = output.tqfind( ':', pos );
}
// user IDs are printed in UTF-8 by gpg (if one uses --with-colons)
key->addUserID( userID );
}
else if( !strncmp( output.data() + index, "fpr:", 4 ) )
- { // line tqcontains a fingerprint
+ { // line contains a fingerprint
// Example: fpr:::::::::17AFBAAF21064E513F037E6E63CB691DFAEBD5FC:
if (key == 0) // invalid key data
@@ -801,8 +801,8 @@ BaseG::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
// search the fingerprint (it's in the 10th field)
int pos = index + 4;
for( int i = 0; i < 8; i++ )
- pos = output.find( ':', pos ) + 1;
- int pos2 = output.find( ':', pos );
+ pos = output.tqfind( ':', pos ) + 1;
+ int pos2 = output.tqfind( ':', pos );
key->setFingerprint( keyID, output.mid( pos, pos2-pos ) );
}
@@ -830,9 +830,9 @@ BaseG::parseKeyList( const TQCString& output, bool secretKeys )
offset = 0;
else {
if( secretKeys )
- offset = output.find( "\nsec:" );
+ offset = output.tqfind( "\nsec:" );
else
- offset = output.find( "\npub:" );
+ offset = output.tqfind( "\npub:" );
if( offset == -1 )
return keys;
else
diff --git a/libkpgp/kpgpblock.cpp b/libkpgp/kpgpblock.cpp
index 9d0a68055..4e5f92393 100644
--- a/libkpgp/kpgpblock.cpp
+++ b/libkpgp/kpgpblock.cpp
@@ -27,7 +27,7 @@ Block::Block( const TQCString& str )
: mText(str), mProcessedText(), mError(),
mSignatureUserId(), mSignatureKeyId(), mSignatureDate(),
mRequiredKey(), mEncryptedFor(),
- mStatus(0), mHasBeenProcessed(false), mType(NoPgpBlock)
+ mtqStatus(0), mHasBeenProcessed(false), mType(NoPgpBlock)
{
mEncryptedFor.setAutoDelete( true );
}
@@ -41,12 +41,12 @@ Block::reset()
{
mProcessedText = TQCString();
mError = TQCString();
- mSignatureUserId = TQString::null;
+ mSignatureUserId = TQString();
mSignatureKeyId = TQCString();
mSignatureDate = TQCString();
mRequiredKey = TQCString();
mEncryptedFor.clear();
- mStatus = 0;
+ mtqStatus = 0;
mHasBeenProcessed = false;
}
diff --git a/libkpgp/kpgpblock.h b/libkpgp/kpgpblock.h
index c741062a8..bb36e3fd9 100644
--- a/libkpgp/kpgpblock.h
+++ b/libkpgp/kpgpblock.h
@@ -58,7 +58,7 @@ typedef enum {
NO_SEC_KEY = 0x0100,
MISSINGKEY = 0x0200,
CANCEL = 0x8000
-} MessageStatus;
+} MessagetqStatus;
class Base;
class Module;
@@ -103,7 +103,7 @@ class KDE_EXPORT Block
void setProcessedText( const TQCString& str );
int status() const;
- void seStatus( const int status );
+ void setqStatus( const int status );
BlockType type();
@@ -186,14 +186,14 @@ class KDE_EXPORT Block
TQCString mRequiredKey;
TQString mRequiredUserId;
TQStrList mEncryptedFor;
- int mStatus;
+ int mtqStatus;
bool mHasBeenProcessed;
BlockType mType;
};
// -- inlined member functions ---------------------------------------------
-inline QCString
+inline TQCString
Block::text() const
{
if( mHasBeenProcessed )
@@ -216,7 +216,7 @@ Block::setProcessedText( const TQCString& str )
mHasBeenProcessed = true;
}
-inline QCString
+inline TQCString
Block::error() const
{
return mError;
@@ -231,13 +231,13 @@ Block::setError( const TQCString& str )
inline int
Block::status() const
{
- return mStatus;
+ return mtqStatus;
}
inline void
-Block::seStatus( const int status )
+Block::setqStatus( const int status )
{
- mStatus = status;
+ mtqStatus = status;
}
inline BlockType
@@ -248,7 +248,7 @@ Block::type()
return mType;
}
-inline QString
+inline TQString
Block::signatureUserId() const
{
return mSignatureUserId;
@@ -260,7 +260,7 @@ Block::setSignatureUserId( const TQString& userId )
mSignatureUserId = userId;
}
-inline QCString
+inline TQCString
Block::signatureKeyId() const
{
return mSignatureKeyId;
@@ -272,7 +272,7 @@ Block::setSignatureKeyId( const TQCString& keyId )
mSignatureKeyId = keyId;
}
-inline QCString
+inline TQCString
Block::signatureDate() const
{
return mSignatureDate;
@@ -284,7 +284,7 @@ Block::setSignatureDate( const TQCString& date )
mSignatureDate = date;
}
-inline QString
+inline TQString
Block::requiredKey() const
{
return mRequiredKey;
@@ -296,7 +296,7 @@ Block::setRequiredKey( const TQCString& keyId )
mRequiredKey = keyId;
}
-inline QString
+inline TQString
Block::requiredUserId() const
{
return mRequiredUserId;
@@ -308,7 +308,7 @@ Block::setRequiredUserId( const TQString& userId )
mRequiredUserId = userId;
}
-inline const QStrList
+inline const TQStrList
Block::encryptedFor() const
{
return mEncryptedFor;
@@ -317,7 +317,7 @@ Block::encryptedFor() const
inline bool
Block::isEncrypted() const
{
- if( mStatus & ENCRYPTED )
+ if( mtqStatus & ENCRYPTED )
return true;
return false;
}
@@ -325,7 +325,7 @@ Block::isEncrypted() const
inline bool
Block::isSigned() const
{
- if( mStatus & SIGNED )
+ if( mtqStatus & SIGNED )
return true;
return false;
}
@@ -333,7 +333,7 @@ Block::isSigned() const
inline bool
Block::goodSignature() const
{
- if( mStatus & GOODSIG )
+ if( mtqStatus & GOODSIG )
return true;
return false;
}
@@ -342,7 +342,7 @@ Block::goodSignature() const
inline bool
Block::unknownSigner() const
{
- if( mStatus & UNKNOWN_SIG )
+ if( mtqStatus & UNKNOWN_SIG )
return true;
return false;
}
diff --git a/libkpgp/kpgpkey.cpp b/libkpgp/kpgpkey.cpp
index 8a8ed48b8..b646fdf1d 100644
--- a/libkpgp/kpgpkey.cpp
+++ b/libkpgp/kpgpkey.cpp
@@ -209,7 +209,7 @@ bool Key::matchesUserID(const TQString& str, bool cs)
return false;
for (UserIDListIterator it(mUserIDs); it.current(); ++it) {
- if (((*it)->text().find(str, 0, cs)) != -1)
+ if (((*it)->text().tqfind(str, 0, cs)) != -1)
return true;
}
diff --git a/libkpgp/kpgpkey.h b/libkpgp/kpgpkey.h
index a0cf9b624..63d8feb4b 100644
--- a/libkpgp/kpgpkey.h
+++ b/libkpgp/kpgpkey.h
@@ -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 TQString& uid = TQString::null,
+ const TQString& uid = TQString(),
const bool secret = false);
~Key();
@@ -697,7 +697,7 @@ inline TQString Key::primaryUserID() const
if (uid)
return uid->text();
else
- return TQString::null;
+ return TQString();
}
inline KeyID Key::primaryKeyID() const
diff --git a/libkpgp/kpgpui.cpp b/libkpgp/kpgpui.cpp
index 294560465..11bd79294 100644
--- a/libkpgp/kpgpui.cpp
+++ b/libkpgp/kpgpui.cpp
@@ -58,10 +58,10 @@ const int Kpgp::KeySelectionDialog::sCheckSelectionDelay = 250;
namespace Kpgp {
-PassphraseDialog::PassphraseDialog( TQWidget *parent,
+PassphraseDialog::PassphraseDialog( TQWidget *tqparent,
const TQString &caption, bool modal,
const TQString &keyID )
- :KDialogBase( parent, 0, modal, caption, Ok|Cancel )
+ :KDialogBase( tqparent, 0, modal, caption, Ok|Cancel )
{
TQHBox *hbox = makeHBoxMainWidget();
hbox->setSpacing( spacingHint() );
@@ -104,8 +104,8 @@ const char * PassphraseDialog::passphrase()
// ------------------------------------------------------------------------
// Forbidden accels for KMail: AC GH OP
// for KNode: ACE H O
-Config::Config( TQWidget *parent, const char *name, bool encrypt )
- : TQWidget( parent, name ), pgp( Module::getKpgp() )
+Config::Config( TQWidget *tqparent, const char *name, bool encrypt )
+ : TQWidget( tqparent, name ), pgp( Module::getKpgp() )
{
TQGroupBox * group;
TQLabel * label;
@@ -116,7 +116,7 @@ Config::Config( TQWidget *parent, const char *name, bool encrypt )
group = new TQVGroupBox( i18n("Warning"), this );
group->tqlayout()->setSpacing( KDialog::spacingHint() );
- // (mmutz) work around Qt label bug in 3.0.0 (and possibly later):
+ // (mmutz) work around TQt label bug in 3.0.0 (and possibly later):
// 1. Don't use rich text: No <qt><b>...</b></qt>
label = new TQLabel( i18n("Please check if encryption really "
"works before you start using it seriously. Also note that attachments "
@@ -205,7 +205,7 @@ Config::Config( TQWidget *parent, const char *name, bool encrypt )
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 application will only show the dialog if it cannot tqfind "
"the right key or if there are several which could be used. "
"</p></qt>" );
TQWhatsThis::add( showKeyApprovalDlg, msg );
@@ -286,9 +286,9 @@ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList,
const bool rememberChoice,
const unsigned int allowedKeys,
const bool extendedSelection,
- TQWidget *parent, const char *name,
+ TQWidget *tqparent, const char *name,
bool modal )
- : KDialogBase( parent, name, modal, title, Default|Ok|Cancel, Ok ),
+ : KDialogBase( tqparent, name, modal, title, Default|Ok|Cancel, Ok ),
mRememberCB( 0 ),
mAllowedKeys( allowedKeys ),
mCurrentContextMenuItem( 0 )
@@ -368,7 +368,7 @@ KeySelectionDialog::KeySelectionDialog( const KeyList& keyList,
slotCheckSelection( lvi );
}
// make sure that the selected item is visible
- // (ensureItemVisible(...) doesn't work correctly in Qt 3.0.0)
+ // (ensureItemVisible(...) doesn't work correctly in TQt 3.0.0)
if( lvi != 0 )
mListView->center( mListView->contentsX(), mListView->itemPos( lvi ) );
@@ -542,13 +542,13 @@ TQString KeySelectionDialog::keyInfo( const Kpgp::Key *key ) const
dt.setTime_t( key->creationDate() );
if( remark.isEmpty() ) {
return " " + i18n("creation date and status of an OpenPGP key",
- "Creation date: %1, Status: %2")
+ "Creation date: %1, tqStatus: %2")
.arg( KGlobal::locale()->formatDate( dt.date(), true ) )
.arg( status );
}
else {
return " " + i18n("creation date, status and remark of an OpenPGP key",
- "Creation date: %1, Status: %2 (%3)")
+ "Creation date: %1, tqStatus: %2 (%3)")
.arg( KGlobal::locale()->formatDate( dt.date(), true ) )
.arg( status )
.arg( remark );
@@ -670,8 +670,8 @@ void KeySelectionDialog::updateKeyInfo( const Kpgp::Key* key,
return;
}
- if( lvi->parent() != 0 ) {
- lvi = lvi->parent();
+ if( lvi->tqparent() != 0 ) {
+ lvi = lvi->tqparent();
}
if( 0 == key ) {
@@ -788,8 +788,8 @@ KeySelectionDialog::getKeyId( const TQListViewItem* lvi ) const
KeyID keyId;
if( 0 != lvi ) {
- if( 0 != lvi->parent() ) {
- keyId = lvi->parent()->text(0).local8Bit();
+ if( 0 != lvi->tqparent() ) {
+ keyId = lvi->tqparent()->text(0).local8Bit();
}
else {
keyId = lvi->text(0).local8Bit();
@@ -1158,9 +1158,9 @@ void KeySelectionDialog::showAllItems()
}
// ------------------------------------------------------------------------
-KeyRequester::KeyRequester( TQWidget * parent, bool multipleKeys,
+KeyRequester::KeyRequester( TQWidget * tqparent, bool multipleKeys,
unsigned int allowedKeys, const char * name )
- : TQWidget( parent, name ),
+ : TQWidget( tqparent, name ),
mDialogCaption( i18n("OpenPGP Key Selection") ),
mDialogMessage( i18n("Please select an OpenPGP key to use.") ),
mMulti( multipleKeys ),
@@ -1268,9 +1268,9 @@ void KeyRequester::setAllowedKeys( int allowedKeys ) {
}
-PublicKeyRequester::PublicKeyRequester( TQWidget * parent, bool multi,
+PublicKeyRequester::PublicKeyRequester( TQWidget * tqparent, bool multi,
unsigned int allowed, const char * name )
- : KeyRequester( parent, multi, allowed & ~SecretKeys, name )
+ : KeyRequester( tqparent, multi, allowed & ~SecretKeys, name )
{
}
@@ -1281,12 +1281,12 @@ PublicKeyRequester::~PublicKeyRequester() {
KeyIDList PublicKeyRequester::keyRequestHook( Module * pgp ) const {
assert( pgp );
- return pgp->selectPublicKeys( mDialogCaption, mDialogMessage, mKeys, TQString::null, mAllowedKeys );
+ return pgp->selectPublicKeys( mDialogCaption, mDialogMessage, mKeys, TQString(), mAllowedKeys );
}
-SecretKeyRequester::SecretKeyRequester( TQWidget * parent, bool multi,
+SecretKeyRequester::SecretKeyRequester( TQWidget * tqparent, bool multi,
unsigned int allowed, const char * name )
- : KeyRequester( parent, multi, allowed & ~PublicKeys, name )
+ : KeyRequester( tqparent, multi, allowed & ~PublicKeys, name )
{
}
@@ -1310,9 +1310,9 @@ KeyIDList SecretKeyRequester::keyRequestHook( Module * pgp ) const {
KeyApprovalDialog::KeyApprovalDialog( const TQStringList& addresses,
const TQValueVector<KeyIDList>& keyIDs,
const int allowedKeys,
- TQWidget *parent, const char *name,
+ TQWidget *tqparent, const char *name,
bool modal )
- : KDialogBase( parent, name, modal, i18n("Encryption Key Approval"),
+ : KDialogBase( tqparent, name, modal, i18n("Encryption Key Approval"),
Ok|Cancel, Ok ),
mKeys( keyIDs ),
mAllowedKeys( allowedKeys ),
@@ -1614,9 +1614,9 @@ KeyApprovalDialog::slotCancel()
// ------------------------------------------------------------------------
CipherTextDialog::CipherTextDialog( const TQCString & text,
- const TQCString & charset, TQWidget *parent,
+ const TQCString & charset, TQWidget *tqparent,
const char *name, bool modal )
- :KDialogBase( parent, name, modal, i18n("OpenPGP Information"), Ok|Cancel, Ok)
+ :KDialogBase( tqparent, name, modal, i18n("OpenPGP Information"), Ok|Cancel, Ok)
{
// FIXME (post KDE2.2): show some more info, e.g. the output of GnuPG/PGP
TQFrame *page = makeMainWidget();
@@ -1674,7 +1674,7 @@ void CipherTextDialog::setMinimumSize()
}
#endif
- mEditBox->setMinimumWidth( QMIN( textWidth, maxWidth ) );
+ mEditBox->setMinimumWidth( TQMIN( textWidth, maxWidth ) );
}
void KeyRequester::virtual_hook( int, void* ) {}
diff --git a/libkpgp/kpgpui.h b/libkpgp/kpgpui.h
index 8cb41953f..1c24373a9 100644
--- a/libkpgp/kpgpui.h
+++ b/libkpgp/kpgpui.h
@@ -55,10 +55,11 @@ class KeyIDList; // needed by KeySelectionDialog
class KDE_EXPORT PassphraseDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- PassphraseDialog( TQWidget *parent=0, const TQString &caption=TQString::null,
- bool modal=true, const TQString &keyID=TQString::null);
+ PassphraseDialog( TQWidget *tqparent=0, const TQString &caption=TQString(),
+ bool modal=true, const TQString &keyID=TQString());
virtual ~PassphraseDialog();
const char * passphrase();
@@ -72,12 +73,13 @@ class KDE_EXPORT PassphraseDialog : public KDialogBase
/** a widget for configuring the pgp interface. Can be included into
a tabdialog. This widget by itself does not provide an apply/cancel
button mechanism. */
-class KDE_EXPORT Config : public QWidget
+class KDE_EXPORT Config : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- Config(TQWidget *parent = 0, const char *name = 0, bool encrypt =true);
+ Config(TQWidget *tqparent = 0, const char *name = 0, bool encrypt =true);
virtual ~Config();
virtual void setValues();
@@ -102,6 +104,7 @@ class KDE_EXPORT Config : public QWidget
class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper
{
Q_OBJECT
+ TQ_OBJECT
enum TrustCheckMode { NoExpensiveTrustCheck,
AllowExpensiveTrustCheck,
@@ -113,12 +116,12 @@ class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper
*/
KeySelectionDialog( const KeyList& keyList,
const TQString& title,
- const TQString& text = TQString::null,
+ const TQString& text = TQString(),
const KeyIDList& keyIds = KeyIDList(),
const bool rememberChoice = false,
const unsigned int allowedKeys = AllKeys,
const bool extendedSelection = false,
- TQWidget *parent=0, const char *name=0,
+ TQWidget *tqparent=0, const char *name=0,
bool modal=true );
virtual ~KeySelectionDialog();
@@ -198,12 +201,13 @@ class KDE_EXPORT KeySelectionDialog: public KeySelectionDialogSuper
static const int sCheckSelectionDelay;
};
-class KDE_EXPORT KeyRequester: public QWidget
+class KDE_EXPORT KeyRequester: public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KeyRequester( TQWidget * parent=0, bool multipleKeys=false,
+ KeyRequester( TQWidget * tqparent=0, bool multipleKeys=false,
unsigned int allowedKeys=AllKeys, const char * name=0 );
virtual ~KeyRequester();
@@ -252,8 +256,9 @@ protected:
class KDE_EXPORT PublicKeyRequester : public KeyRequester {
Q_OBJECT
+ TQ_OBJECT
public:
- PublicKeyRequester( TQWidget * parent=0, bool multipleKeys=false,
+ PublicKeyRequester( TQWidget * tqparent=0, bool multipleKeys=false,
unsigned int allowedKeys=PublicKeys, const char * name=0 );
virtual ~PublicKeyRequester();
@@ -271,8 +276,9 @@ protected:
class KDE_EXPORT SecretKeyRequester : public KeyRequester {
Q_OBJECT
+ TQ_OBJECT
public:
- SecretKeyRequester( TQWidget * parent=0, bool multipleKeys=false,
+ SecretKeyRequester( TQWidget * tqparent=0, bool multipleKeys=false,
unsigned int allowedKeys=SecretKeys, const char * name=0 );
virtual ~SecretKeyRequester();
@@ -292,12 +298,13 @@ protected:
class KDE_EXPORT KeyApprovalDialog: public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
KeyApprovalDialog( const TQStringList&,
const TQValueVector<KeyIDList>&,
const int allowedKeys,
- TQWidget *parent = 0, const char *name = 0,
+ TQWidget *tqparent = 0, const char *name = 0,
bool modal = true );
virtual ~KeyApprovalDialog() {};
@@ -327,10 +334,11 @@ class KDE_EXPORT KeyApprovalDialog: public KDialogBase
class KDE_EXPORT CipherTextDialog: public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
CipherTextDialog( const TQCString & text, const TQCString & charset=0,
- TQWidget *parent=0, const char *name=0, bool modal=true );
+ TQWidget *tqparent=0, const char *name=0, bool modal=true );
virtual ~CipherTextDialog() {};
private: