1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

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
This commit is contained in:
Harald Sitter 2017-08-29 12:35:11 +02:00
parent e5b89fd5f5
commit 58e4b9a3a7

View File

@ -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