kcontrol: write Name entry for custom desktop files from autostart KCM

otherwise it is empty the next time autostart KCM loads the .desktop files

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-04 11:48:13 +02:00
parent 4560049c4a
commit 12bb86ae51

View file

@ -222,7 +222,8 @@ void Autostart::slotAddProgram()
desktopTemplate = KUrl(desktopPath); desktopTemplate = KUrl(desktopPath);
KConfig kc(desktopTemplate.path(), KConfig::SimpleConfig); KConfig kc(desktopTemplate.path(), KConfig::SimpleConfig);
KConfigGroup kcg = kc.group("Desktop Entry"); KConfigGroup kcg = kc.group("Desktop Entry");
kcg.writeEntry("Exec" ,service->exec()); kcg.writeEntry("Name", service->exec());
kcg.writeEntry("Exec", service->exec());
kcg.writeEntry("Icon", "system-run"); kcg.writeEntry("Icon", "system-run");
kcg.writeEntry("Path", ""); kcg.writeEntry("Path", "");
kcg.writeEntry("Terminal", false); kcg.writeEntry("Terminal", false);
@ -243,8 +244,8 @@ void Autostart::slotAddProgram()
return; return;
} }
} }
DesktopStartItem * item = new DesktopStartItem( desktopPath, m_programItem,this ); DesktopStartItem * item = new DesktopStartItem(desktopPath, m_programItem, this);
addItem( item, service->name(), service->exec() , false); addItem(item, service->name(), service->exec(), false);
} }
void Autostart::slotRemoveCMD() void Autostart::slotRemoveCMD()