feat: connect to system bus signal for monitor application changed

for dpkg

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe 2023-09-06 16:15:00 +08:00 committed by Comix
parent f3381a4387
commit cc4c928dc1

View File

@ -49,6 +49,16 @@ ApplicationManager1Service::ApplicationManager1Service(std::unique_ptr<Identifie
this,
&ApplicationManager1Service::removeInstanceFromApplication);
auto sysBus = QDBusConnection::systemBus();
if (!sysBus.connect("org.desktopspec.ApplicationUpdateNotifier1",
"/org/desktopspec/ApplicationUpdateNotifier1",
"org.desktopspec.ApplicationUpdateNotifier1",
"ApplicationUpdated",
this,
SLOT(ReloadApplications()))) {
qFatal("connect to ApplicationUpdated failed.");
}
scanApplications();
scanInstances();