Auto-find Clazy documentation also with clazy >= 1.4

Summary:
BUG: 401075
FIXED-IN: 5.3.1

Test Plan:
Remove entries from kdeveloprc, paths are auto.detected both with
clazy 1.4 and clazy 1.3 (well, its simulated doc path).

Reviewers: #kdevelop, kfunk

Reviewed By: #kdevelop, kfunk

Subscribers: kfunk, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D16910
parent a3c782ac
......@@ -109,16 +109,21 @@ QUrl JobGlobalParameters::defaultExecutablePath()
QUrl JobGlobalParameters::defaultDocsPath()
{
const auto docsPath = QStandardPaths::locate(
QStandardPaths::GenericDataLocation,
const QString subPathsCandidates[2]{
// since clazy 1.4
QStringLiteral("doc/clazy"),
// before
QStringLiteral("clazy/doc"),
QStandardPaths::LocateDirectory);
};
for (auto subPath : subPathsCandidates) {
const auto docsPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath, QStandardPaths::LocateDirectory);
if (docsPath.isEmpty()) {
return {};
if (!docsPath.isEmpty()) {
return QUrl::fromLocalFile(QDir(docsPath).canonicalPath());
}
}
return QUrl::fromLocalFile(QDir(docsPath).canonicalPath());
return {};
}
bool JobGlobalParameters::isValid() const
......
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