Commit 782d5ad6 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Port from XdgBaseDirs::findExecutableFile() to QStandardPaths::findExecutable()

The added functionality of XdgBaseDirs to look for agent binaries in
alternative locations on Windows is no longer necessary as the new way
of deploying applications on Windows is in a single bundle so the
binaries will be always in the same installation prefix.

All the other functionality is already provided by QStandardPaths.
parent b06336aa
......@@ -540,7 +540,7 @@ void AgentManager::readPluginInfos(const QDir &directory)
}
if (agentInfo.launchMethod == AgentType::Process) {
const QString executable = Akonadi::XdgBaseDirs::findExecutableFile(agentInfo.exec);
const QString executable = QStandardPaths::findExecutable(agentInfo.exec);
if (executable.isEmpty()) {
qCWarning(AKONADICONTROL_LOG) << "Executable" << agentInfo.exec << "for agent" << agentInfo.identifier << "could not be found!";
continue;
......
......@@ -23,7 +23,7 @@
#include "processcontrol.h"
#include "akonadicontrol_debug.h"
#include <private/xdgbasedirs_p.h>
#include <QStandardPaths>
using namespace Akonadi;
......@@ -45,7 +45,7 @@ bool AgentProcessInstance::start(const AgentType &agentInfo)
agentInfo.launchMethod == AgentType::Launcher);
const QString executable = (agentInfo.launchMethod == AgentType::Process)
? XdgBaseDirs::findExecutableFile(agentInfo.exec) : agentInfo.exec;
? QStandardPaths::findExecutable(agentInfo.exec) : agentInfo.exec;
if (executable.isEmpty()) {
qCWarning(AKONADICONTROL_LOG) << "Unable to find agent executable" << agentInfo.exec;
......@@ -61,7 +61,7 @@ bool AgentProcessInstance::start(const AgentType &agentInfo)
} else {
Q_ASSERT(agentInfo.launchMethod == AgentType::Launcher);
const QStringList arguments = QStringList() << executable << identifier();
const QString agentLauncherExec = XdgBaseDirs::findExecutableFile(QStringLiteral("akonadi_agent_launcher"));
const QString agentLauncherExec = QStandardPaths::findExecutable(QStringLiteral("akonadi_agent_launcher"));
mController->start(agentLauncherExec, arguments);
}
return true;
......
......@@ -33,6 +33,7 @@
#include <QSqlError>
#include <QSqlQuery>
#include <QCoreApplication>
#include <QStandardPaths>
using namespace Akonadi;
using namespace Akonadi::Server;
......@@ -86,10 +87,10 @@ bool DbConfigMysql::init(QSettings &settings)
<< QStringLiteral("/opt/local/lib/mysql5/bin")
<< QStringLiteral("/opt/mysql/sbin");
if (defaultServerPath.isEmpty()) {
defaultServerPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqld"), mysqldSearchPath);
defaultServerPath = QStandardPaths::findExecutable(QStringLiteral("mysqld"), mysqldSearchPath);
}
const QString mysqladminPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqladmin"), mysqldSearchPath);
const QString mysqladminPath = QStandardPaths::findExecutable(QStringLiteral("mysqladmin"), mysqldSearchPath);
if (!mysqladminPath.isEmpty()) {
#ifndef Q_OS_WIN
defaultCleanShutdownCommand = QStringLiteral("%1 --defaults-file=%2/mysql.conf --socket=%3/mysql.socket shutdown")
......@@ -99,10 +100,10 @@ bool DbConfigMysql::init(QSettings &settings)
#endif
}
mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysql_install_db"), mysqldSearchPath);
mMysqlInstallDbPath = QStandardPaths::findExecutable(QStringLiteral("mysql_install_db"), mysqldSearchPath);
qCDebug(AKONADISERVER_LOG) << "Found mysql_install_db: " << mMysqlInstallDbPath;
mMysqlCheckPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqlcheck"), mysqldSearchPath);
mMysqlCheckPath = QStandardPaths::findExecutable(QStringLiteral("mysqlcheck"), mysqldSearchPath);
qCDebug(AKONADISERVER_LOG) << "Found mysqlcheck: " << mMysqlCheckPath;
mInternalServer = settings.value(QStringLiteral("QMYSQL/StartServer"), defaultInternalServer).toBool();
......
......@@ -29,6 +29,7 @@
#include <QSqlDriver>
#include <QSqlError>
#include <QSqlQuery>
#include <QStandardPaths>
#include <config-akonadi.h>
#ifdef HAVE_UNISTD_H
......@@ -96,9 +97,8 @@ bool DbConfigPostgresql::init(QSettings &settings)
}
}
postgresSearchPath.append(postgresVersionedSearchPaths);
defaultServerPath = XdgBaseDirs::findExecutableFile(QStringLiteral("pg_ctl"), postgresSearchPath);
defaultInitDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("initdb"), postgresSearchPath);
defaultServerPath = QStandardPaths::findExecutable(QStringLiteral("pg_ctl"), postgresSearchPath);
defaultInitDbPath = QStandardPaths::findExecutable(QStringLiteral("initdb"), postgresSearchPath);
defaultHostName = Utils::preferredSocketDirectory(StandardDirs::saveDir("data", QStringLiteral("db_misc")));
defaultPgData = StandardDirs::saveDir("data", QStringLiteral("db_data"));
}
......
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