feat: emit signal when AutoStart Changed

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-09-08 10:58:41 +08:00
committed by deepin-bot[bot]
parent ac71f99bc6
commit dc96c21c7d
7 changed files with 118 additions and 6 deletions

View File

@ -6,6 +6,7 @@
#include "APPobjectmanager1adaptor.h"
#include "applicationchecker.h"
#include "applicationmanager1service.h"
#include "propertiesForwarder.h"
#include "dbus/instanceadaptor.h"
#include "launchoptions.h"
#include <QUuid>
@ -84,6 +85,11 @@ QSharedPointer<ApplicationService> ApplicationService::createApplicationService(
return nullptr;
}
if (auto *ptr = new (std::nothrow) PropertiesForwarder{app->m_applicationPath.path(), app.data()}; ptr == nullptr) {
qCritical() << "new PropertiesForwarder of Application failed.";
return nullptr;
}
return app;
}
@ -402,12 +408,14 @@ bool ApplicationService::autostartCheck(const QString &linkPath) noexcept
{
QFileInfo info{linkPath};
if (!info.exists() or !info.isSymbolicLink()) {
if (info.exists()) {
if (info.isSymbolicLink()) {
return true;
}
qWarning() << "same name desktop file exists:" << linkPath << "but this may not created by AM.";
return false;
}
return true;
return false;
}
bool ApplicationService::isAutoStart() const noexcept
@ -437,6 +445,8 @@ void ApplicationService::setAutoStart(bool autostart) noexcept
}
}
}
emit autostartChanged();
}
QList<QDBusObjectPath> ApplicationService::instances() const noexcept