From 71afe1ec6eab59911c8e8cbc9a67c1a850c1a041 Mon Sep 17 00:00:00 2001 From: phit <2097483+phit@users.noreply.github.com> Date: Mon, 6 Sep 2021 22:28:35 +0200 Subject: [PATCH] NOISSUE Detection of multiple custom theme folders --- launcher/MultiMC.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/launcher/MultiMC.cpp b/launcher/MultiMC.cpp index c532ce8264..d97b1b2bcb 100644 --- a/launcher/MultiMC.cpp +++ b/launcher/MultiMC.cpp @@ -766,7 +766,19 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) insertTheme(new SystemTheme()); insertTheme(darkTheme); insertTheme(new BrightTheme()); - insertTheme(new CustomTheme(darkTheme, "custom")); + + QDirIterator it("themes", QDir::Dirs | QDir::NoDot | QDir::NoDotDot | QDir::Readable, QDirIterator::FollowSymlinks); + while (it.hasNext()) + { + auto filepath = it.next(); + QFileInfo file(filepath); + QString themeDir = file.baseName(); + if(file.isDir()) + { + qDebug() << "Found custom theme: " << themeDir; + insertTheme(new CustomTheme(darkTheme, themeDir)); + } + } qDebug() << "<> Widget themes initialized."; }