summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/cryptography/kgpginterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/plugins/cryptography/kgpginterface.cpp')
-rw-r--r--kopete/plugins/cryptography/kgpginterface.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kopete/plugins/cryptography/kgpginterface.cpp b/kopete/plugins/cryptography/kgpginterface.cpp
index 51b35a63..e41e246d 100644
--- a/kopete/plugins/cryptography/kgpginterface.cpp
+++ b/kopete/plugins/cryptography/kgpginterface.cpp
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <kprocio.h>
@@ -40,10 +40,10 @@ KgpgInterface::KgpgInterface()
KgpgInterface::~KgpgInterface()
{}
-QString KgpgInterface::KgpgEncryptText(QString text,QString userIDs, QString Options)
+TQString KgpgInterface::KgpgEncryptText(TQString text,TQString userIDs, TQString Options)
{
FILE *fp;
- QString dests,encResult;
+ TQString dests,encResult;
char buffer[200];
userIDs=userIDs.stripWhiteSpace();
@@ -59,7 +59,7 @@ QString KgpgInterface::KgpgEncryptText(QString text,QString userIDs, QString Opt
}
dests+=" --recipient "+userIDs;
- QCString gpgcmd = "echo -n ";
+ TQCString gpgcmd = "echo -n ";
gpgcmd += KShellProcess::quote( text ).utf8();
gpgcmd += " | gpg --no-secmem-warning --no-tty ";
gpgcmd += Options.local8Bit();
@@ -75,17 +75,17 @@ QString KgpgInterface::KgpgEncryptText(QString text,QString userIDs, QString Opt
if( !encResult.isEmpty() )
return encResult;
else
- return QString::null;
+ return TQString::null;
}
-QString KgpgInterface::KgpgDecryptText(QString text,QString userID)
+TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID)
{
FILE *fp,*pass;
- QString encResult;
+ TQString encResult;
char buffer[200];
int counter=0,ppass[2];
- QCString password = CryptographyPlugin::cachedPass();
+ TQCString password = CryptographyPlugin::cachedPass();
bool passphraseHandling=CryptographyPlugin::passphraseHandling();
while ((counter<3) && (encResult.isEmpty()))
@@ -94,16 +94,16 @@ QString KgpgInterface::KgpgDecryptText(QString text,QString userID)
if(passphraseHandling && password.isNull())
{
/// pipe for passphrase
- //userID=QString::fromUtf8(userID);
+ //userID=TQString::fromUtf8(userID);
userID.replace('<',"&lt;");
- QString passdlg=i18n("Enter passphrase for <b>%1</b>:").arg(userID);
+ TQString passdlg=i18n("Enter passphrase for <b>%1</b>:").arg(userID);
if (counter>1)
- passdlg.prepend(i18n("<b>Bad passphrase</b><br> You have %1 tries left.<br>").arg(QString::number(4-counter)));
+ passdlg.prepend(i18n("<b>Bad passphrase</b><br> You have %1 tries left.<br>").arg(TQString::number(4-counter)));
/// pipe for passphrase
int code=KPasswordDialog::getPassword(password,passdlg);
- if (code!=QDialog::Accepted)
- return QString::null;
+ if (code!=TQDialog::Accepted)
+ return TQString::null;
CryptographyPlugin::setCachedPass(password);
}
@@ -116,29 +116,29 @@ QString KgpgInterface::KgpgDecryptText(QString text,QString userID)
fclose(pass);
}
- QCString gpgcmd="echo ";
+ TQCString gpgcmd="echo ";
gpgcmd += KShellProcess::quote(text).utf8();
gpgcmd += " | gpg --no-secmem-warning --no-tty ";
if(passphraseHandling)
- gpgcmd += "--passphrase-fd " + QString::number(ppass[0]).local8Bit();
+ gpgcmd += "--passphrase-fd " + TQString::number(ppass[0]).local8Bit();
gpgcmd += " -d ";
////////// encode with untrusted keys or armor if checked by user
fp = popen(gpgcmd, "r");
while ( fgets( buffer, sizeof(buffer), fp))
- encResult += QString::fromUtf8(buffer);
+ encResult += TQString::fromUtf8(buffer);
pclose(fp);
- password = QCString();
+ password = TQCString();
}
if( !encResult.isEmpty() )
return encResult;
else
- return QString::null;
+ return TQString::null;
}
-QString KgpgInterface::checkForUtf8(QString txt)
+TQString KgpgInterface::checkForUtf8(TQString txt)
{
// code borrowed from gpa
@@ -147,7 +147,7 @@ QString KgpgInterface::checkForUtf8(QString txt)
/* Make sure the encoding is UTF-8.
* Test structure suggested by Werner Koch */
if (txt.isEmpty())
- return QString::null;
+ return TQString::null;
for (s = txt.ascii(); *s && !(*s & 0x80); s++)
;
@@ -157,17 +157,17 @@ QString KgpgInterface::checkForUtf8(QString txt)
/* The string is not in UTF-8 */
//if (strchr (txt.ascii(), 0xc3)) return (txt+" +++");
if (txt.find("\\x")==-1)
- return QString::fromUtf8(txt.ascii());
+ return TQString::fromUtf8(txt.ascii());
// if (!strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) {
for ( int idx = 0 ; (idx = txt.find( "\\x", idx )) >= 0 ; ++idx ) {
char str[2] = "x";
- str[0] = (char) QString( txt.mid( idx + 2, 2 ) ).toShort( 0, 16 );
+ str[0] = (char) TQString( txt.mid( idx + 2, 2 ) ).toShort( 0, 16 );
txt.replace( idx, 4, str );
}
if (!strchr (txt.ascii(), 0xc3))
- return QString::fromUtf8(txt.ascii());
+ return TQString::fromUtf8(txt.ascii());
else
- return QString::fromUtf8(QString::fromUtf8(txt.ascii()).ascii()); // perform Utf8 twice, or some keys display badly
+ return TQString::fromUtf8(TQString::fromUtf8(txt.ascii()).ascii()); // perform Utf8 twice, or some keys display badly
}