diff options
author | Weblate <noreply@weblate.org> | 2017-08-17 16:02:53 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-08-17 16:02:53 +0000 |
commit | e22937e90e6be7820e11cc9eba47bd0fb1b394e9 (patch) | |
tree | bb65904fd9aeee5e6325d12675e10f58cee25b80 /src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp | |
parent | Translated using Weblate (Spanish) (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-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/qsspage.cpp')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp | 25 |
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(){ |