summaryrefslogtreecommitdiffstats
path: root/libkpgp/kpgpbase.cpp
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/kpgpbase.cpp
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/kpgpbase.cpp')
-rw-r--r--libkpgp/kpgpbase.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp
index ec2ffd12..5f31fe5a 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;