KPasswordEdit: Add a password conversion to local8Bit()

using setCodecForCStrings. This resolves bug 2961.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/16/head
Slávek Banko 6 years ago
parent 38e386a7e2
commit b4034166a5
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -33,6 +33,7 @@
#include <tqwhatsthis.h>
#include <tqptrdict.h>
#include <tqtimer.h>
#include <tqtextcodec.h>
#include <tdeglobal.h>
#include <kdebug.h>
@ -139,7 +140,11 @@ KPasswordEdit::~KPasswordEdit()
}
const char *KPasswordEdit::password() const {
return text().ascii();
TQTextCodec *origCStringCodec = TQTextCodec::codecForCStrings();
TQTextCodec::setCodecForCStrings(TQTextCodec::codecForLocale());
const char *outputPassword = text().ascii();
TQTextCodec::setCodecForCStrings(origCStringCodec);
return outputPassword;
}
void KPasswordEdit::erase()

Loading…
Cancel
Save