From f8d298d624106330f58445b11104ed45d85a1592 Mon Sep 17 00:00:00 2001
From: mhogomchungu <mhogomchungu@gmail.com>
Date: Thu, 4 Aug 2022 15:25:33 +0300
Subject: [PATCH] fix a password issue with kwallet

---
 frontend/lxqt_kwallet-dbus.cpp | 2 +-
 frontend/lxqt_kwallet.cpp      | 4 ++--
 frontend/lxqt_wallet.h         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/frontend/lxqt_kwallet-dbus.cpp b/frontend/lxqt_kwallet-dbus.cpp
index 72cd0fb..37ada08 100644
--- a/frontend/lxqt_kwallet-dbus.cpp
+++ b/frontend/lxqt_kwallet-dbus.cpp
@@ -161,7 +161,7 @@ QByteArray LXQt::Wallet::kwallet_dbus::readValue(const QString &key)
     QDBusReply<QString> m = m_dbus.call("readPassword", m_handle, m_folder, key, m_applicationName) ;
 
     if (m.isValid()){
-        return m.value().toLatin1();
+        return m.value().toUtf8();
     }else{
         m_log("LXQt::Wallet::kwallet_dbus: readPassword dbus call failed: " + m.error().message());
         return {};
diff --git a/frontend/lxqt_kwallet.cpp b/frontend/lxqt_kwallet.cpp
index 89dbb8a..3eb19c9 100644
--- a/frontend/lxqt_kwallet.cpp
+++ b/frontend/lxqt_kwallet.cpp
@@ -141,7 +141,7 @@ QByteArray LXQt::Wallet::kwallet::readValue(const QString &key)
 
     m_kwallet->readPassword(key, value);
 
-    return value.toLatin1();
+    return value.toUtf8();
 }
 
 QVector<std::pair<QString, QByteArray>> LXQt::Wallet::kwallet::readAllKeyValues(void)
@@ -160,7 +160,7 @@ QVector<std::pair<QString, QByteArray>> LXQt::Wallet::kwallet::readAllKeyValues(
 
         m_kwallet->readPassword(e, value);
 
-	p.append({ e, value.toLatin1() });
+	p.append({ e, value.toUtf8() });
     }
 
     return p;
diff --git a/frontend/lxqt_wallet.h b/frontend/lxqt_wallet.h
index 6675f5f..659c505 100644
--- a/frontend/lxqt_wallet.h
+++ b/frontend/lxqt_wallet.h
@@ -123,7 +123,7 @@ class Q_DECL_EXPORT Wallet : public QWidget
      */
     bool addKey(const QString &key,const QString &value)
     {
-        return this->addKey(key, value.toLatin1());
+	return this->addKey(key, value.toUtf8());
     }
 
     /*
