Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 51542514 authored by patrick pereira's avatar patrick pereira 🏃

debugger: DataLocation is deprecated, move to AppDataLocation

Summary:
Signed-off-by: patrick pereira's avatarPatrick José Pereira <patrickelectric@gmail.com>

debugger: Use a stringlist to search in different paths for debugger configuration files
Signed-off-by: patrick pereira's avatarPatrick José Pereira <patrickelectric@gmail.com>

Reviewers: mart, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17024
parent 62c33ba3
......@@ -128,16 +128,23 @@ void Debugger::expandString(QString & str, ExpandStringUsage usage, const QStrin
//static
QList<Debugger> Debugger::availableDebuggers(const QString & path, const QString & backend)
{
QString debuggerDir = QStandardPaths::locate(QStandardPaths::DataLocation, path, QStandardPaths::LocateDirectory);
QStringList debuggers = QDir(debuggerDir).entryList(QDir::Files);
QStringList debuggerDirs {
// Search in default path
QStandardPaths::locate(QStandardPaths::AppDataLocation, path, QStandardPaths::LocateDirectory),
// Search from application path, this helps when deploying an application
QString(QStringLiteral("%1/%2")).arg(QCoreApplication::applicationDirPath(), path)
};
QList<Debugger> result;
foreach (const QString & debuggerFile, debuggers) {
Debugger debugger;
debugger.m_config = KSharedConfig::openConfig(debuggerDir +QLatin1Char('/')+ debuggerFile);
if (debugger.supportedBackends().contains(backend)) {
debugger.setUsedBackend(backend);
result.append(debugger);
for (const auto & debuggerDir: debuggerDirs) {
QStringList debuggers = QDir(debuggerDir).entryList(QDir::Files);
for (const auto & debuggerFile : debuggers) {
Debugger debugger;
debugger.m_config = KSharedConfig::openConfig(QString(QStringLiteral("%1/%2")).arg(debuggerDir, debuggerFile));
if (debugger.supportedBackends().contains(backend)) {
debugger.setUsedBackend(backend);
result.append(debugger);
}
}
}
return result;
......
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