Commit 8712e581 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated qt5.15 methods

parent 526bb9d7
......@@ -179,7 +179,11 @@ void FakeClient::run()
mSocket = new QLocalSocket();
mSocket->connectToServer(FakeAkonadiServer::socketFile());
connect(mSocket, &QLocalSocket::disconnected, this, &FakeClient::connectionLost);
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
connect(mSocket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
#else
connect(mSocket, &QLocalSocket::errorOccurred,
#endif
this, [this]() {
qWarning() << "Client socket error: " << mSocket->errorString();
connectionLost();
......
......@@ -73,7 +73,11 @@ void Session::connectToHost()
}
QLocalSocket *socket = new QLocalSocket(this);
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
connect(socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error), this, &Session::serverError);
#else
connect(socket, &QLocalSocket::errorOccurred, this, &Session::serverError);
#endif
connect(socket, &QLocalSocket::disconnected, this, &Session::serverDisconnected);
connect(socket, &QIODevice::readyRead, this, &Session::serverRead);
connect(socket, &QLocalSocket::connected, this, &Session::inputAvailable);
......
......@@ -169,7 +169,11 @@ void Connection::doReconnect()
}
mSocket.reset(new QLocalSocket(this));
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
connect(mSocket.data(), static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(&QLocalSocket::error), this,
#else
connect(mSocket.data(), &QLocalSocket::errorOccurred, this,
#endif
[this](QLocalSocket::LocalSocketError) {
qCWarning(AKONADICORE_LOG) << mSocket->errorString() << mSocket->serverName();
Q_EMIT socketError(mSocket->errorString());
......
......@@ -222,7 +222,7 @@ bool ServerManager::stop()
void ServerManager::showSelfTestDialog(QWidget *parent)
{
Q_UNUSED(parent);
QProcess::startDetached(QStringLiteral("akonadiselftest"));
QProcess::startDetached(QStringLiteral("akonadiselftest"), QStringList());
}
bool ServerManager::isRunning()
......
......@@ -78,11 +78,7 @@ void Connection::init()
if (!socket->setSocketDescriptor(m_socketDescriptor)) {
qCWarning(AKONADISERVER_LOG) << "Connection(" << m_identifier
<< ")::run: failed to set socket descriptor: "
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
<< socket->error()
#else
<< socket->socketError()
#endif
<< "(" << socket->errorString() << ")";
return;
}
......
......@@ -540,7 +540,7 @@ void DbConfigMysql::stopInternalServer()
// first, try the nicest approach
if (!mCleanServerShutdownCommand.isEmpty()) {
QProcess::execute(mCleanServerShutdownCommand);
QProcess::execute(mCleanServerShutdownCommand, QStringList());
if (mDatabaseProcess->waitForFinished(3000)) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment