From a657df4232e637f5560a6ec5138fb066565310d7 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 10 Jun 2021 21:25:46 +0200 Subject: [PATCH] [kcms/autostart] Avoid empty application icon If no icon is available use a fallback one (cherry picked from commit b23778bcc7cadf9b685ce72a187bb15942a80c07) --- kcms/autostart/autostartmodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kcms/autostart/autostartmodel.cpp b/kcms/autostart/autostartmodel.cpp index e4ac3287d..3df272b10 100644 --- a/kcms/autostart/autostartmodel.cpp +++ b/kcms/autostart/autostartmodel.cpp @@ -73,7 +73,7 @@ std::optional AutostartModel::loadDesktopEntry(const QString &fi const auto lstEntry = grp.readXdgListEntry("OnlyShowIn"); const bool onlyInPlasma = lstEntry.contains(QLatin1String("KDE")); - const QString iconName = config.readIcon(); + const QString iconName = !config.readIcon().isEmpty() ? config.readIcon() : QStringLiteral("dialog-scripts"); const auto kind = AutostartScriptDesktopFile::isAutostartScript(config) ? XdgScripts : XdgAutoStart; // .config/autostart load desktop at startup const QString tryCommand = grp.readEntry("TryExec"); @@ -235,12 +235,14 @@ void AutostartModel::addApplication(const KService::Ptr &service) newDeskTopFile->sync(); } + const QString iconName = !service->icon().isEmpty() ? service->icon() : QStringLiteral("dialog-scripts"); + const auto entry = AutostartEntry{service->name(), AutostartModel::AutostartEntrySource::XdgAutoStart, // .config/autostart load desktop at startup true, desktopPath, false, - service->icon()}; + iconName}; int lastApplication = -1; for (const AutostartEntry &e : qAsConst(m_entries)) {