feat: add property Launcher, Orphaned

refactor some method which are related with systemd unit

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-09-13 16:52:53 +08:00
committed by Comix
parent 23dcd13f10
commit bc7fbfb3a1
14 changed files with 168 additions and 82 deletions

View File

@ -33,20 +33,18 @@ bool SystemdSignalDispatcher::connectToSignals() noexcept
void SystemdSignalDispatcher::onUnitNew(QString unitName, QDBusObjectPath systemdUnitPath)
{
decltype(auto) appPrefix = u8"app-";
if (!unitName.startsWith(appPrefix)) {
if (!unitName.startsWith("app-")) {
return;
}
emit SystemdUnitNew(unitName.sliced(sizeof(appPrefix) - 1), systemdUnitPath);
emit SystemdUnitNew(unitName, systemdUnitPath);
}
void SystemdSignalDispatcher::onUnitRemoved(QString unitName, QDBusObjectPath systemdUnitPath)
{
decltype(auto) appPrefix = u8"app-";
if (!unitName.startsWith(appPrefix)) {
if (!unitName.startsWith("app-")) {
return;
}
emit SystemdUnitRemoved(unitName.sliced(sizeof(appPrefix) - 1), systemdUnitPath);
emit SystemdUnitRemoved(unitName, systemdUnitPath);
}