1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
From 3eaa0d6ab1c7efc0bdd91fcd789d8187c6c27678 Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Thu, 24 Jun 2021 12:34:13 +0200
Subject: [PATCH] Bump to Qt 5.15, port away from deprecated APIs
---
CMakeLists.txt | 2 +-
README.md | 2 +-
src/auth/Auth.cpp | 6 +++---
src/auth/AuthRequest.cpp | 2 +-
src/common/ConfigReader.cpp | 4 ++--
src/daemon/PowerManager.cpp | 8 ++++++--
src/daemon/XorgDisplayServer.cpp | 17 +++++++++--------
src/greeter/GreeterProxy.cpp | 2 +-
8 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41aee21d4..6936b31f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,7 +96,7 @@ find_package(XCB REQUIRED)
find_package(XKB REQUIRED)
# Qt 5
-find_package(Qt5 5.8.0 CONFIG REQUIRED Core DBus Gui Qml Quick LinguistTools Test)
+find_package(Qt5 5.15.0 CONFIG REQUIRED Core DBus Gui Qml Quick LinguistTools Test)
# find qt5 imports dir
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
diff --git a/README.md b/README.md
index 7c7a55588..97cb2221c 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ money that can be used to support the features that you most desire.
## INSTALLATION
-Qt >= 5.8.0 is required to use SDDM.
+Qt >= 5.15.0 is required to use SDDM.
SDDM runs the greeter as a system user named "sddm" whose home directory needs
to be set to `/var/lib/sddm`.
diff --git a/src/auth/Auth.cpp b/src/auth/Auth.cpp
index 4450cc606..1dc2dd186 100644
--- a/src/auth/Auth.cpp
+++ b/src/auth/Auth.cpp
@@ -134,7 +134,7 @@ namespace SDDM {
env.insert(QStringLiteral("LANG"), QStringLiteral("C"));
child->setProcessEnvironment(env);
connect(child, QOverload<int,QProcess::ExitStatus>::of(&QProcess::finished), this, &Auth::Private::childExited);
- connect(child, QOverload<QProcess::ProcessError>::of(&QProcess::error), this, &Auth::Private::childError);
+ connect(child, &QProcess::errorOccurred, this, &Auth::Private::childError);
connect(request, &AuthRequest::finished, this, &Auth::Private::requestFinished);
connect(request, &AuthRequest::promptsChanged, parent, &Auth::requestChanged);
}
@@ -267,8 +267,8 @@ namespace SDDM {
}
void Auth::registerTypes() {
- qmlRegisterType<AuthPrompt>();
- qmlRegisterType<AuthRequest>();
+ qmlRegisterAnonymousType<AuthPrompt>("Auth", 1);
+ qmlRegisterAnonymousType<AuthRequest>("Auth", 1);
qmlRegisterType<Auth>("Auth", 1, 0, "Auth");
}
diff --git a/src/auth/AuthRequest.cpp b/src/auth/AuthRequest.cpp
index 9583b0a4d..9ccc2d259 100644
--- a/src/auth/AuthRequest.cpp
+++ b/src/auth/AuthRequest.cpp
@@ -73,7 +73,7 @@ namespace SDDM {
}
QQmlListProperty<AuthPrompt> AuthRequest::promptsDecl() {
- return QQmlListProperty<AuthPrompt>(this, d->prompts);
+ return QQmlListProperty<AuthPrompt>(this, &d->prompts);
}
void AuthRequest::done() {
diff --git a/src/common/ConfigReader.cpp b/src/common/ConfigReader.cpp
index 041e5ed22..503b55e69 100644
--- a/src/common/ConfigReader.cpp
+++ b/src/common/ConfigReader.cpp
@@ -265,7 +265,7 @@ namespace SDDM {
QByteArray junk;
// stores the junk to the temporary storage
auto collectJunk = [&junk](const QString &data) {
- junk.append(data);
+ junk.append(data.toUtf8());
};
// a short function to assign the current junk and current line to the right section, eventually create a new one
@@ -275,7 +275,7 @@ namespace SDDM {
sectionData[currentSection] = QByteArray();
}
sectionData[currentSection].append(junk);
- sectionData[currentSection].append(data);
+ sectionData[currentSection].append(data.toUtf8());
junk.clear();
};
diff --git a/src/daemon/PowerManager.cpp b/src/daemon/PowerManager.cpp
index 6eca29f55..ab1d6ac03 100644
--- a/src/daemon/PowerManager.cpp
+++ b/src/daemon/PowerManager.cpp
@@ -87,11 +87,15 @@ const QString UPOWER_OBJECT = QStringLiteral("org.freedesktop.UPower");
}
void powerOff() const {
- QProcess::execute(mainConfig.HaltCommand.get());
+ auto command = QProcess::splitCommand(mainConfig.HaltCommand.get());
+ const QString program = command.takeFirst();
+ QProcess::execute(program, command);
}
void reboot() const {
- QProcess::execute(mainConfig.RebootCommand.get());
+ auto command = QProcess::splitCommand(mainConfig.RebootCommand.get());
+ const QString program = command.takeFirst();
+ QProcess::execute(program, command);
}
void suspend() const {
diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp
index fc61ee2dd..13a1691b8 100644
--- a/src/daemon/XorgDisplayServer.cpp
+++ b/src/daemon/XorgDisplayServer.cpp
@@ -110,7 +110,7 @@ namespace SDDM {
QStringList args;
if (!daemonApp->testing()) {
process->setProgram(mainConfig.X11.ServerPath.get());
- args << mainConfig.X11.ServerArguments.get().split(QLatin1Char(' '), QString::SkipEmptyParts)
+ args << mainConfig.X11.ServerArguments.get().split(QLatin1Char(' '), Qt::SkipEmptyParts)
<< QStringLiteral("-background") << QStringLiteral("none")
<< QStringLiteral("-seat") << displayPtr()->seat()->name()
<< QStringLiteral("vt%1").arg(displayPtr()->terminalId());
@@ -221,7 +221,7 @@ namespace SDDM {
// log message
qDebug() << "Display server stopped.";
- QString displayStopCommand = mainConfig.X11.DisplayStopCommand.get();
+ QStringList displayStopCommand = QProcess::splitCommand(mainConfig.X11.DisplayStopCommand.get());
// create display setup script process
QProcess *displayStopScript = new QProcess();
@@ -236,7 +236,8 @@ namespace SDDM {
// start display stop script
qDebug() << "Running display stop script " << displayStopCommand;
- displayStopScript->start(displayStopCommand);
+ const auto program = displayStopCommand.takeFirst();
+ displayStopScript->start(program, displayStopCommand);
// wait for finished
if (!displayStopScript->waitForFinished(5000))
@@ -254,8 +255,6 @@ namespace SDDM {
}
void XorgDisplayServer::setupDisplay() {
- QString displayCommand = mainConfig.X11.DisplayCommand.get();
-
// create cursor setup process
QProcess *setCursor = new QProcess();
// create display setup script process
@@ -273,7 +272,7 @@ namespace SDDM {
displayScript->setProcessEnvironment(env);
qDebug() << "Setting default cursor";
- setCursor->start(QStringLiteral("xsetroot -cursor_name left_ptr"));
+ setCursor->start(QStringLiteral("xsetroot"), { QStringLiteral("-cursor_name"), QStringLiteral("left_ptr") });
// delete setCursor on finish
connect(setCursor, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), setCursor, &QProcess::deleteLater);
@@ -285,8 +284,10 @@ namespace SDDM {
}
// start display setup script
- qDebug() << "Running display setup script " << displayCommand;
- displayScript->start(displayCommand);
+ qDebug() << "Running display setup script " << mainConfig.X11.DisplayCommand.get();
+ QStringList displayCommand = QProcess::splitCommand(mainConfig.X11.DisplayCommand.get());
+ const QString program = displayCommand.takeFirst();
+ displayScript->start(program, displayCommand);
// delete displayScript on finish
connect(displayScript, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), displayScript, &QProcess::deleteLater);
diff --git a/src/greeter/GreeterProxy.cpp b/src/greeter/GreeterProxy.cpp
index 8fde3d904..d6e62cc75 100644
--- a/src/greeter/GreeterProxy.cpp
+++ b/src/greeter/GreeterProxy.cpp
@@ -46,7 +46,7 @@ namespace SDDM {
connect(d->socket, &QLocalSocket::connected, this, &GreeterProxy::connected);
connect(d->socket, &QLocalSocket::disconnected, this, &GreeterProxy::disconnected);
connect(d->socket, &QLocalSocket::readyRead, this, &GreeterProxy::readyRead);
- connect(d->socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error), this, &GreeterProxy::error);
+ connect(d->socket, &QLocalSocket::errorOccurred, this, &GreeterProxy::error);
// connect to server
d->socket->connectToServer(socket);
|