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