refact: change implementation of UpdateApplicationInfo
adjust the way of get XDG_DATA_DIRS. Signed-off-by: ComixHe <heyuming@deepin.org> Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
@ -33,18 +33,20 @@ bool SystemdSignalDispatcher::connectToSignals() noexcept
|
||||
|
||||
void SystemdSignalDispatcher::onUnitNew(QString unitName, QDBusObjectPath systemdUnitPath)
|
||||
{
|
||||
if (!unitName.startsWith("app-")) {
|
||||
constexpr decltype(auto) appPrefix = u8"app-";
|
||||
if (!unitName.startsWith(appPrefix)) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit SystemdUnitNew(unitName.sliced(sizeof("app-") - 1), systemdUnitPath);
|
||||
emit SystemdUnitNew(unitName.sliced(sizeof(appPrefix) - 1), systemdUnitPath);
|
||||
}
|
||||
|
||||
void SystemdSignalDispatcher::onUnitRemoved(QString unitName, QDBusObjectPath systemdUnitPath)
|
||||
{
|
||||
if (!unitName.startsWith("app-")) {
|
||||
constexpr decltype(auto) appPrefix = u8"app-";
|
||||
if (!unitName.startsWith(appPrefix)) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit SystemdUnitRemoved(unitName.sliced(sizeof("app-") - 1), systemdUnitPath);
|
||||
emit SystemdUnitRemoved(unitName.sliced(sizeof(appPrefix) - 1), systemdUnitPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user