Don't display annoying "you need to restart" message on first run, don't try...

Don't display annoying "you need to restart" message on first run, don't try to enforce breeze icon theme if not available
parent 89eba4d2
......@@ -41,6 +41,7 @@
#include <QCommandLineParser>
#include <QDir>
#include <QIcon>
#include <KIconTheme>
#include <QProcess>
#include <QQmlEngine>
#include <QUrl> //new
......@@ -75,8 +76,13 @@ int main(int argc, char *argv[])
qCDebug(KDENLIVE_LOG) << "KDE Desktop detected, using system icons";
} else {
// We are not on a KDE desktop, force breeze icon theme
grp.writeEntry("force_breeze", true);
qCDebug(KDENLIVE_LOG) << "Non KDE Desktop detected, forcing Breeze icon theme";
// Check if breeze theme is available
QStringList iconThemes = KIconTheme::list();
if (iconThemes.contains(QStringLiteral("breeze"))) {
grp.writeEntry("force_breeze", true);
grp.writeEntry("use_dark_breeze", true);
qCDebug(KDENLIVE_LOG) << "Non KDE Desktop detected, forcing Breeze icon theme";
}
}
}
......
......@@ -168,9 +168,8 @@ void MainWindow::init()
// Init color theme
KActionMenu *themeAction = new KActionMenu(i18n("Theme"), this);
ThemeManager::instance()->setThemeMenuAction(themeAction);
connect(ThemeManager::instance(), &ThemeManager::signalThemeChanged, this, &MainWindow::slotThemeChanged, Qt::DirectConnection);
ThemeManager::instance()->setCurrentTheme(KdenliveSettings::colortheme());
connect(ThemeManager::instance(), &ThemeManager::signalThemeChanged, this, &MainWindow::slotThemeChanged, Qt::DirectConnection);
if (!KdenliveSettings::widgetstyle().isEmpty() && QString::compare(desktopStyle, KdenliveSettings::widgetstyle(), Qt::CaseInsensitive) != 0) {
// User wants a custom widget style, init
doChangeStyle();
......@@ -644,7 +643,9 @@ void MainWindow::slotThemeChanged(const QString &theme)
QColor background = plt.window().color();
bool useDarkIcons = background.value() < 100;
if (KdenliveSettings::force_breeze() && useDarkIcons != KdenliveSettings::use_dark_breeze()) {
KSharedConfigPtr kconfig = KSharedConfig::openConfig();
KConfigGroup initialGroup(kconfig, "version");
if (initialGroup.exists() && KdenliveSettings::force_breeze() && useDarkIcons != KdenliveSettings::use_dark_breeze()) {
// We need to reload icon theme
KdenliveSettings::setUse_dark_breeze(useDarkIcons);
if (KMessageBox::warningContinueCancel(this, i18n("Kdenlive needs to be restarted to apply color theme change. Restart now ?")) ==
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment