aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-08-17 16:02:28 +0000
committerWeblate <noreply@weblate.org>2017-08-17 16:02:28 +0000
commit073b18e631b0837ce4126d1f23a384d5e64266b6 (patch)
tree9ca53c29b4f6a2f4ebb931753fe90bd4a478a802 /src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
parentTranslated using Weblate (Swedish) (diff)
parentClean up more of the lumina-xconfig tiling options. much nicer now. (diff)
downloadlumina-073b18e631b0837ce4126d1f23a384d5e64266b6.tar.gz
lumina-073b18e631b0837ce4126d1f23a384d5e64266b6.tar.bz2
lumina-073b18e631b0837ce4126d1f23a384d5e64266b6.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
index d690ef5d..2cf0f221 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
@@ -95,8 +95,7 @@ void QSSPage::on_removeButton_clicked(){
void QSSPage::readSettings(){
//load stylesheets
m_ui->qssListWidget->clear();
- findStyleSheets(lthemeengine::userStyleSheetPath());
- findStyleSheets(lthemeengine::sharedStyleSheetPath().join(", "));
+ findStyleSheets(QStringList() << lthemeengine::userStyleSheetPath() << lthemeengine::sharedStyleSheetPath());
QSettings settings(lthemeengine::configFile(), QSettings::IniFormat);
QStringList styleSheets = settings.value("Interface/stylesheets").toStringList();
for(int i = 0; i < m_ui->qssListWidget->count(); ++i){
@@ -106,16 +105,20 @@ void QSSPage::readSettings(){
}
}
-void QSSPage::findStyleSheets(const QString &path){
- QDir dir(path);
- dir.setFilter(QDir::Files);
- dir.setNameFilters(QStringList() << "*.qss");
- foreach (QFileInfo info, dir.entryInfoList()){
- QListWidgetItem *item = new QListWidgetItem(info.fileName(), m_ui->qssListWidget);
- item->setToolTip(info.filePath());
- item->setData(QSS_FULL_PATH_ROLE, info.filePath());
- item->setData(QSS_WRITABLE_ROLE, info.isWritable());
+void QSSPage::findStyleSheets(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() << "*.qss");
+ foreach (QFileInfo info, dir.entryInfoList()){
+ QListWidgetItem *item = new QListWidgetItem(info.fileName(), m_ui->qssListWidget);
+ item->setToolTip(info.filePath());
+ item->setData(QSS_FULL_PATH_ROLE, info.filePath());
+ item->setData(QSS_WRITABLE_ROLE, info.isWritable());
}
+ }
}
void QSSPage::on_renameButton_clicked(){
bgstack15