From 53fe3bf43aeb43f51f6b6ebb7453938e85c0223b Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 1 Dec 2018 23:39:45 +0900 Subject: Adapted to new KPasswordEdit::password() signature. This relates to bug 2961. Signed-off-by: Michele Calgaro --- kopete/plugins/cryptography/cryptographyplugin.cpp | 6 +++--- kopete/plugins/cryptography/cryptographyplugin.h | 6 +++--- kopete/plugins/cryptography/kgpginterface.cpp | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'kopete/plugins') diff --git a/kopete/plugins/cryptography/cryptographyplugin.cpp b/kopete/plugins/cryptography/cryptographyplugin.cpp index 5e10cec9..ae38143f 100644 --- a/kopete/plugins/cryptography/cryptographyplugin.cpp +++ b/kopete/plugins/cryptography/cryptographyplugin.cpp @@ -117,12 +117,12 @@ CryptographyPlugin* CryptographyPlugin::plugin() CryptographyPlugin* CryptographyPlugin::pluginStatic_ = 0L; -TQCString CryptographyPlugin::cachedPass() +TQString CryptographyPlugin::cachedPass() { return pluginStatic_->m_cachedPass; } -void CryptographyPlugin::setCachedPass(const TQCString& p) +void CryptographyPlugin::setCachedPass(const TQString& p) { if(pluginStatic_->mCacheMode==Never) return; @@ -308,7 +308,7 @@ void CryptographyPlugin::slotSelectContactKey() void CryptographyPlugin::slotForgetCachedPass() { - m_cachedPass=TQCString(); + m_cachedPass=TQString(); m_cachedPass_timer->stop(); } diff --git a/kopete/plugins/cryptography/cryptographyplugin.h b/kopete/plugins/cryptography/cryptographyplugin.h index ad96767e..05d0ecfa 100644 --- a/kopete/plugins/cryptography/cryptographyplugin.h +++ b/kopete/plugins/cryptography/cryptographyplugin.h @@ -51,8 +51,8 @@ public: }; static CryptographyPlugin *plugin(); - static TQCString cachedPass(); - static void setCachedPass(const TQCString &pass); + static TQString cachedPass(); + static void setCachedPass(const TQString &pass); static bool passphraseHandling(); static const TQRegExp isHTML; @@ -75,7 +75,7 @@ private slots: private: static CryptographyPlugin* pluginStatic_; Kopete::SimpleMessageHandlerFactory *m_inboundHandler; - TQCString m_cachedPass; + TQString m_cachedPass; TQTimer *m_cachedPass_timer; //cache messages for showing diff --git a/kopete/plugins/cryptography/kgpginterface.cpp b/kopete/plugins/cryptography/kgpginterface.cpp index 5763e910..79cd2510 100644 --- a/kopete/plugins/cryptography/kgpginterface.cpp +++ b/kopete/plugins/cryptography/kgpginterface.cpp @@ -85,7 +85,7 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID) char buffer[200]; int counter=0,ppass[2]; - TQCString password = CryptographyPlugin::cachedPass(); + TQString password = CryptographyPlugin::cachedPass(); bool passphraseHandling=CryptographyPlugin::passphraseHandling(); while ((counter<3) && (encResult.isEmpty())) @@ -111,7 +111,8 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID) { pipe(ppass); pass = fdopen(ppass[1], "w"); - fwrite(password, sizeof(char), strlen(password), pass); + TQCString pass2 = password.local8Bit(); + fwrite(pass2, sizeof(char), pass2.length(), pass); // fwrite("\n", sizeof(char), 1, pass); fclose(pass); } @@ -129,7 +130,7 @@ TQString KgpgInterface::KgpgDecryptText(TQString text,TQString userID) encResult += TQString::fromUtf8(buffer); pclose(fp); - password = TQCString(); + password.fill(' '); } if( !encResult.isEmpty() ) -- cgit v1.2.3