From 58e4b9a3a774cc2787d758ec241995593a058db5 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Tue, 29 Aug 2017 12:35:11 +0200 Subject: [PATCH] extend data paths with standard paths from QStandardPaths Summary: this is, for now, backwards compatible. in the long run a full move to QSP instead of manually doing path lookup would be good though. as that ideally means aligning capitalization between appname and on-disk paths we'll avoid that for now. fixes data lookup from XDG paths making the binary partially relocatable and properly configurable via XDG paths (e.g. corporate branding or what have you) Test Plan: - theme path resolution now walks all XDG paths Reviewers: drosca Reviewed By: drosca Differential Revision: https://phabricator.kde.org/D7600 --- src/lib/app/datapaths.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/app/datapaths.cpp b/src/lib/app/datapaths.cpp index ab6c54584..4a566f508 100644 --- a/src/lib/app/datapaths.cpp +++ b/src/lib/app/datapaths.cpp @@ -97,6 +97,14 @@ void DataPaths::init() m_paths[Themes].append(m_paths[AppData].at(0) + QLatin1String("/themes")); m_paths[Plugins].append(m_paths[AppData].at(0) + QLatin1String("/plugins")); + // Add standard data lookup paths (our appname has a capital F so we manually construct + // the final paths for now) + for (auto location : QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { + m_paths[Translations].append(location + QLatin1String("/falkon/locale")); + m_paths[Themes].append(location + QLatin1String("/falkon/themes")); + m_paths[Plugins].append(location + QLatin1String("/falkon/plugins")); + } + // Config #if defined(Q_OS_WIN) || defined(Q_OS_OS2) // Use %LOCALAPPDATA%/falkon as Config path on Windows