Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6c93ad

Browse filesBrowse files
committed
Fix build Qt 6.2 MSVC2019 Windows
1 parent d08486d commit e6c93ad
Copy full SHA for e6c93ad

File tree

8 files changed

+25
-16
lines changed
Filter options

8 files changed

+25
-16
lines changed

‎src/plugins/servicebackends/standard/standardservicecontrol.cpp

Copy file name to clipboardExpand all lines: src/plugins/servicebackends/standard/standardservicecontrol.cpp
+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ QString StandardServiceControl::serviceName() const
193193
if (info.isExecutable())
194194
return QFileInfo{serviceId()}.completeBaseName();
195195
else
196-
return serviceId().split(QLatin1Char('/'), QString::SkipEmptyParts).last();
196+
return serviceId().split(QLatin1Char('/'), Qt::SkipEmptyParts).last();
197197
}
198198

199199
QSharedPointer<QLockFile> StandardServiceControl::statusLock() const

‎src/plugins/servicebackends/windows/windowsservicebackend.cpp

Copy file name to clipboardExpand all lines: src/plugins/servicebackends/windows/windowsservicebackend.cpp
+9-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int WindowsServiceBackend::runService(int &argc, char **argv, int flags)
8888
if(_status.dwWin32ExitCode != NO_ERROR)
8989
return EXIT_FAILURE;
9090
// generate "local" arguments
91-
auto sArgc = _svcArgs.size();
91+
int sArgc = _svcArgs.size();
9292
QVector<char*> sArgv;
9393
sArgv.reserve(sArgc);
9494
for(auto &arg : _svcArgs)
@@ -98,7 +98,7 @@ int WindowsServiceBackend::runService(int &argc, char **argv, int flags)
9898
// create and prepare the coreapp
9999
qCDebug(logBackend) << "setting status to start pending";
100100
setStatus(SERVICE_START_PENDING);
101-
QCoreApplication app(sArgc, sArgv.data(), flags);
101+
QCoreApplication app(sArgc, sArgv.data(), flags);
102102
app.installNativeEventFilter(new SvcEventFilter{});
103103
setStatus(SERVICE_START_PENDING);
104104
if(!preStartService())
@@ -368,8 +368,13 @@ void WindowsServiceBackend::SvcControlThread::run()
368368
}
369369

370370

371-
372-
bool WindowsServiceBackend::SvcEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
371+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
372+
bool WindowsServiceBackend::SvcEventFilter::nativeEventFilter(
373+
const QByteArray &eventType, void *message, long *result)
374+
#else
375+
bool WindowsServiceBackend::SvcEventFilter::nativeEventFilter(
376+
const QByteArray &eventType, void *message, long long *result)
377+
#endif
373378
{
374379
if(eventType == "windows_generic_MSG" ||
375380
eventType == "windows_dispatcher_MSG") {

‎src/plugins/servicebackends/windows/windowsservicebackend.h

Copy file name to clipboardExpand all lines: src/plugins/servicebackends/windows/windowsservicebackend.h
+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ private Q_SLOTS:
4444
class SvcEventFilter : public QAbstractNativeEventFilter
4545
{
4646
public:
47-
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
47+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
48+
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
49+
#else
50+
bool nativeEventFilter(const QByteArray &eventType, void *message, long long *result);
51+
#endif
4852
};
4953

5054
static QPointer<WindowsServiceBackend> _backendInstance;

‎src/service/service.h

Copy file name to clipboardExpand all lines: src/service/service.h
+2-2
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ protected Q_SLOTS:
168168

169169
//! Overload for qHash
170170
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::Service::CommandResult key, uint seed = 0) Q_DECL_NOTHROW {
171-
return ::qHash(static_cast<int>(key), seed);
171+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
172172
}
173173
//! Overload for qHash
174174
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::Service::TerminalMode key, uint seed = 0) Q_DECL_NOTHROW {
175-
return ::qHash(static_cast<int>(key), seed);
175+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
176176
}
177177

178178
template<typename TFunction>

‎src/service/servicebackend.h

Copy file name to clipboardExpand all lines: src/service/servicebackend.h
+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private Q_SLOTS:
9090

9191
//! Overload for qHash
9292
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::ServiceBackend::ServiceCommand key, uint seed = 0) Q_DECL_NOTHROW {
93-
return ::qHash(static_cast<int>(key), seed);
93+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
9494
}
9595

9696
template<typename TRet, typename... TArgs>

‎src/service/servicecontrol.h

Copy file name to clipboardExpand all lines: src/service/servicecontrol.h
+3-3
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,15 @@ public Q_SLOTS:
201201

202202
//! Overload for qHash
203203
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::ServiceControl::SupportFlags key, uint seed = 0) Q_DECL_NOTHROW {
204-
return ::qHash(static_cast<int>(key), seed);
204+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
205205
}
206206
//! Overload for qHash
207207
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::ServiceControl::Status key, uint seed = 0) Q_DECL_NOTHROW {
208-
return ::qHash(static_cast<int>(key), seed);
208+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
209209
}
210210
//! Overload for qHash
211211
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(QtService::ServiceControl::BlockMode key, uint seed = 0) Q_DECL_NOTHROW {
212-
return ::qHash(static_cast<int>(key), seed);
212+
return static_cast<uint>(::qHash(static_cast<int>(key), seed));
213213
}
214214

215215
// ------------- Generic Implementations -------------

‎src/service/terminal.cpp

Copy file name to clipboardExpand all lines: src/service/terminal.cpp
+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Terminal::Terminal(TerminalPrivate *d_ptr, QObject *parent) :
3030

3131
connect(d->socket, &QLocalSocket::disconnected,
3232
this, &Terminal::terminalDisconnected);
33-
connect(d->socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
33+
connect(d->socket, &QLocalSocket::errorOccurred,
3434
this, [this](QLocalSocket::LocalSocketError e) {
3535
if(e != QLocalSocket::PeerClosedError) {
3636
setErrorString(d->socket->errorString());
@@ -283,7 +283,7 @@ TerminalPrivate::TerminalPrivate(QLocalSocket *socket, QObject *parent) :
283283

284284
connect(socket, &QLocalSocket::disconnected,
285285
this, &TerminalPrivate::disconnected);
286-
connect(socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
286+
connect(socket, &QLocalSocket::errorOccurred,
287287
this, &TerminalPrivate::error);
288288
connect(socket, &QLocalSocket::readyRead,
289289
this, &TerminalPrivate::readyRead);
@@ -328,7 +328,7 @@ void TerminalPrivate::readyRead()
328328
terminalMode = static_cast<Service::TerminalMode>(tMode);
329329
isLoading = false;
330330
//disconnect all but "disconencted" - that one is needed for auto-delete
331-
disconnect(socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
331+
disconnect(socket, &QLocalSocket::errorOccurred,
332332
this, &TerminalPrivate::error);
333333
disconnect(socket, &QLocalSocket::readyRead,
334334
this, &TerminalPrivate::readyRead);

‎src/service/terminalclient.cpp

Copy file name to clipboardExpand all lines: src/service/terminalclient.cpp
+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void TerminalClient::setupChannels()
255255
this, &TerminalClient::connected);
256256
connect(_socket, &QLocalSocket::disconnected,
257257
this, &TerminalClient::disconnected);
258-
connect(_socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
258+
connect(_socket, &QLocalSocket::errorOccurred,
259259
this, &TerminalClient::error);
260260
connect(_socket, &QLocalSocket::readyRead,
261261
this, &TerminalClient::socketReady,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.