Skip to content

Commit 9889b91

Browse files
committed
Fix PasswdBackend build
Closes #477
1 parent f549210 commit 9889b91

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/helper/backend/PasswdBackend.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace SDDM {
3838
if (m_autologin)
3939
return true;
4040

41-
if (m_user == "sddm") {
41+
if (m_user == QLatin1String("sddm")) {
4242
if (m_greeter)
4343
return true;
4444
else
@@ -49,17 +49,17 @@ namespace SDDM {
4949
QString password;
5050

5151
if (m_user.isEmpty())
52-
r.prompts << Prompt(AuthPrompt::LOGIN_USER, "Login", false);
53-
r.prompts << Prompt(AuthPrompt::LOGIN_PASSWORD, "Password", true);
52+
r.prompts << Prompt(AuthPrompt::LOGIN_USER, QStringLiteral("Login"), false);
53+
r.prompts << Prompt(AuthPrompt::LOGIN_PASSWORD, QStringLiteral("Password"), true);
5454

5555
Request response = m_app->request(r);
5656
Q_FOREACH(const Prompt &p, response.prompts) {
5757
switch (p.type) {
5858
case AuthPrompt::LOGIN_USER:
59-
m_user = p.response;
59+
m_user = QString::fromUtf8(p.response);
6060
break;
6161
case AuthPrompt::LOGIN_PASSWORD:
62-
password = p.response;
62+
password = QString::fromUtf8(p.response);
6363
break;
6464
default:
6565
break;
@@ -68,7 +68,7 @@ namespace SDDM {
6868

6969
struct passwd *pw = getpwnam(qPrintable(m_user));
7070
if (!pw) {
71-
m_app->error(QString("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
71+
m_app->error(QStringLiteral("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
7272
return false;
7373
}
7474

@@ -86,7 +86,7 @@ namespace SDDM {
8686
return true;
8787
}
8888

89-
m_app->error(QString("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
89+
m_app->error(QStringLiteral("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
9090
return false;
9191
}
9292

0 commit comments

Comments
 (0)