diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-06 05:48:52 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-06 05:48:52 +0100 |
commit | 37cc59c04d0573a42d67242135495c0a0729f965 (patch) | |
tree | 35cd453c9d35022dd31f5c2769740b5b80d4ba9c /application/themes/CustomTheme.cpp | |
parent | bc753859b5ab5d1402940024c0478548165b57f8 (diff) | |
download | PrismLauncher-37cc59c04d0573a42d67242135495c0a0729f965.tar.gz PrismLauncher-37cc59c04d0573a42d67242135495c0a0729f965.tar.bz2 PrismLauncher-37cc59c04d0573a42d67242135495c0a0729f965.zip |
GH-378 add a resource search path to custom themes
This allows adding images and other bits and pieces to themes.
Diffstat (limited to 'application/themes/CustomTheme.cpp')
-rw-r--r-- | application/themes/CustomTheme.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/application/themes/CustomTheme.cpp b/application/themes/CustomTheme.cpp index a3141573..70d55211 100644 --- a/application/themes/CustomTheme.cpp +++ b/application/themes/CustomTheme.cpp @@ -128,10 +128,11 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QString folder) { m_id = folder; QString path = FS::PathCombine("themes", m_id); + QString pathResources = FS::PathCombine("themes", m_id, "resources"); qDebug() << "Loading theme" << m_id; - if(!FS::ensureFolderPathExists(path)) + if(!FS::ensureFolderPathExists(path) || !FS::ensureFolderPathExists(pathResources)) { qWarning() << "couldn't create folder for theme!"; m_palette = baseTheme->colorScheme(); @@ -191,6 +192,12 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QString folder) } } +QStringList CustomTheme::searchPaths() +{ + return { FS::PathCombine("themes", m_id, "resources") }; +} + + QString CustomTheme::id() { return m_id; |