diff options
author | Alexey Sokolov <alexey+gentoo@asokolov.org> | 2023-11-10 22:41:37 +0000 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2023-12-23 22:05:55 +0200 |
commit | 83d2aec8200c8232978d20d43701c4442376a316 (patch) | |
tree | e4782149196eb8963e95f31350e41278eecf00da /media-sound/clementine/files | |
parent | x11-wm/enlightenment: add 0.26.0 (diff) | |
download | gentoo-83d2aec8200c8232978d20d43701c4442376a316.tar.gz gentoo-83d2aec8200c8232978d20d43701c4442376a316.tar.bz2 gentoo-83d2aec8200c8232978d20d43701c4442376a316.zip |
media-sound/clementine: read projectm visualizations from subdirs
Closes: https://bugs.gentoo.org/917064
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/33760
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-sound/clementine/files')
-rw-r--r-- | media-sound/clementine/files/clementine-1.4.0_rc2-projectm-dir.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/media-sound/clementine/files/clementine-1.4.0_rc2-projectm-dir.patch b/media-sound/clementine/files/clementine-1.4.0_rc2-projectm-dir.patch new file mode 100644 index 000000000000..8f92766193d6 --- /dev/null +++ b/media-sound/clementine/files/clementine-1.4.0_rc2-projectm-dir.patch @@ -0,0 +1,53 @@ +Read visualisations from subdirs + +https://bugs.gentoo.org/917064 +https://github.com/clementine-player/Clementine/issues/7151 + +--- a/src/visualisations/projectmpresetmodel.cpp ++++ b/src/visualisations/projectmpresetmodel.cpp +@@ -27,22 +27,26 @@ + #endif + + #include <QDir> ++#include <QDirIterator> + #include <QtDebug> ++#include <set> + + ProjectMPresetModel::ProjectMPresetModel(ProjectMVisualisation* vis, + QObject* parent) + : QAbstractItemModel(parent), vis_(vis) { + // Find presets +- QDir preset_dir(vis_->preset_url()); +- QStringList presets( +- preset_dir.entryList(QStringList() << "*.milk" +- << "*.prjm", ++ QDirIterator it(vis_->preset_url(), ++ QStringList() << "*.milk" << "*.prjm", + QDir::Files | QDir::NoDotAndDotDot | QDir::Readable, +- QDir::Name | QDir::IgnoreCase)); ++ QDirIterator::Subdirectories); ++ std::set<std::pair<QString, QString>> files; ++ while (it.hasNext()) { ++ it.next(); ++ files.insert({it.filePath(), it.fileName()}); ++ } + +- for (const QString& filename : presets) { +- all_presets_ << Preset(preset_dir.absoluteFilePath(filename), filename, +- false); ++ for (const auto& [filePath, fileName] : files) { ++ all_presets_ << Preset(filePath, fileName, false); + } + } + +--- a/src/visualisations/projectmvisualisation.cpp ++++ b/src/visualisations/projectmvisualisation.cpp +@@ -93,7 +93,7 @@ void ProjectMVisualisation::InitProjectM() { + if (!QFile::exists(path)) continue; + + // Don't use empty directories +- if (QDir(path).entryList(QDir::Files | QDir::NoDotAndDotDot).isEmpty()) ++ if (QDir(path).entryList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot).isEmpty()) + continue; + + preset_path = path; |