Revert "fix: core dumped under Qt 6.4"

Github bug makes me commit wrong content, revert it.

This reverts commit 6fae5a758b.
This commit is contained in:
black-desk
2023-08-29 10:06:55 +08:00
parent 6fae5a758b
commit 25a7acb6fd
8 changed files with 14 additions and 37 deletions

View File

@ -28,7 +28,8 @@ ApplicationManager1Service::ApplicationManager1Service(std::unique_ptr<Identifie
std::terminate();
}
if (!registerObjectToDBus(this, DDEApplicationManager1ObjectPath, ApplicationManagerInterface)) {
if (!registerObjectToDBus(
this, DDEApplicationManager1ObjectPath, getDBusInterface(QMetaType::fromType<ApplicationManager1Adaptor>()))) {
std::terminate();
}
@ -129,7 +130,8 @@ bool ApplicationManager1Service::addApplication(DesktopFile desktopFileSource) n
return false;
}
if (!registerObjectToDBus(ptr, application->applicationPath().path(), ApplicationInterface)) {
if (!registerObjectToDBus(
ptr, application->applicationPath().path(), getDBusInterface(QMetaType::fromType<ApplicationAdaptor>()))) {
return false;
}
m_applicationList.insert(application->applicationPath(), application);

View File

@ -317,7 +317,7 @@ bool ApplicationService::addOneInstance(const QString &instanceId, const QString
auto *adaptor = new InstanceAdaptor(service);
QString objectPath{m_applicationPath.path() + "/" + instanceId};
if (registerObjectToDBus(service, objectPath, InstanceInterface)) {
if (registerObjectToDBus(service, objectPath, getDBusInterface(QMetaType::fromType<InstanceAdaptor>()))) {
m_Instances.insert(QDBusObjectPath{objectPath}, QSharedPointer<InstanceService>{service});
service->moveToThread(this->thread());
adaptor->moveToThread(this->thread());

View File

@ -9,7 +9,8 @@ JobManager1Service::JobManager1Service(ApplicationManager1Service *parent)
: m_parent(parent)
{
new JobManager1Adaptor{this};
if (!registerObjectToDBus(this, DDEApplicationManager1JobManagerObjectPath, JobManagerInterface)) {
if (!registerObjectToDBus(
this, DDEApplicationManager1JobManagerObjectPath, getDBusInterface(QMetaType::fromType<JobManager1Adaptor>()))) {
std::terminate();
}
qRegisterMetaType<LaunchTask>();

View File

@ -61,7 +61,7 @@ public:
auto *ptr = job.data();
new JobAdaptor(ptr);
if (!registerObjectToDBus(ptr, objectPath, JobInterface)) {
if (!registerObjectToDBus(ptr, objectPath, getDBusInterface(QMetaType::fromType<JobAdaptor>()))) {
qCritical() << "can't register job to dbus.";
future.cancel();
return {};