kdesudo: pass the comment argument as-is from KdeSudo constructor

internally KCmdLineArgs converts from and to the current locale encoding

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-31 19:24:07 +03:00
parent a5017377d2
commit a2a57db88f

View file

@ -29,7 +29,6 @@
#include <QtCore/QProcess>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QTextCodec>
#include <kapplication.h>
#include <kcmdlineargs.h>
@ -89,9 +88,7 @@ KdeSudo::KdeSudo(const QString &icon, const QString &appname)
// Parsins args
/* Get the comment out of cli args */
QByteArray commentBytes = args->getOption("comment").toUtf8();
QTextCodec *tCodecConv = QTextCodec::codecForLocale();
QString comment = tCodecConv->toUnicode(commentBytes, commentBytes.size());
QString comment = args->getOption("comment");
if (args->isSet("f")) {
// If file is writeable, do not change uid