From 37cc59c04d0573a42d67242135495c0a0729f965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 6 Nov 2016 05:48:52 +0100 Subject: GH-378 add a resource search path to custom themes This allows adding images and other bits and pieces to themes. --- application/themes/CustomTheme.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'application/themes/CustomTheme.cpp') 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; -- cgit v1.2.3