aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-08-17 16:02:53 +0000
committerWeblate <noreply@weblate.org>2017-08-17 16:02:53 +0000
commite22937e90e6be7820e11cc9eba47bd0fb1b394e9 (patch)
treebb65904fd9aeee5e6325d12675e10f58cee25b80 /src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
parentTranslated using Weblate (Spanish) (diff)
parentMerge remote-tracking branch 'origin/master' (diff)
downloadlumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.tar.gz
lumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.tar.bz2
lumina-e22937e90e6be7820e11cc9eba47bd0fb1b394e9.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
index 4d585409..04ca6a0b 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
@@ -190,8 +190,7 @@ void AppearancePage::readSettings(){
m_ui->customPaletteButton->setChecked(settings.value("custom_palette", false).toBool());
QString colorSchemePath = settings.value("color_scheme_path").toString();
QDir("/").mkpath(lthemeengine::userColorSchemePath());
- findColorSchemes(lthemeengine::userColorSchemePath());
- findColorSchemes(lthemeengine::sharedColorSchemePath().join(", "));
+ findColorSchemes( QStringList() << lthemeengine::userColorSchemePath() << lthemeengine::sharedColorSchemePath());
if(m_ui->colorSchemeComboBox->count() == 0){
m_customPalette = palette(); //load fallback palette
}
@@ -223,12 +222,16 @@ void AppearancePage::setPalette(QWidget *w, QPalette p){
w->setPalette(p);
}
-void AppearancePage::findColorSchemes(const QString &path){
- QDir dir(path);
- dir.setFilter(QDir::Files);
- dir.setNameFilters(QStringList() << "*.conf");
- foreach (QFileInfo info, dir.entryInfoList()){
- m_ui->colorSchemeComboBox->addItem(info.baseName(), info.filePath());
+void AppearancePage::findColorSchemes(QStringList paths){
+ paths.removeDuplicates();
+ for(int i=0; i<paths.length(); i++){
+ if( !QFile::exists(paths[i])){ continue; }
+ QDir dir(paths[i]);
+ dir.setFilter(QDir::Files);
+ dir.setNameFilters(QStringList() << "*.conf");
+ foreach (QFileInfo info, dir.entryInfoList()){
+ m_ui->colorSchemeComboBox->addItem(info.baseName(), info.filePath());
+ }
}
}
bgstack15