fix: core dumped under Qt 6.4
call method metaObject of QMetaType will coredump under Qt 6.4 Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
@ -28,8 +28,7 @@ ApplicationManager1Service::ApplicationManager1Service(std::unique_ptr<Identifie
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
if (!registerObjectToDBus(
|
||||
this, DDEApplicationManager1ObjectPath, getDBusInterface(QMetaType::fromType<ApplicationManager1Adaptor>()))) {
|
||||
if (!registerObjectToDBus(this, DDEApplicationManager1ObjectPath, ApplicationManagerInterface)) {
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
@ -130,8 +129,7 @@ bool ApplicationManager1Service::addApplication(DesktopFile desktopFileSource) n
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!registerObjectToDBus(
|
||||
ptr, application->applicationPath().path(), getDBusInterface(QMetaType::fromType<ApplicationAdaptor>()))) {
|
||||
if (!registerObjectToDBus(ptr, application->applicationPath().path(), ApplicationInterface)) {
|
||||
return false;
|
||||
}
|
||||
m_applicationList.insert(application->applicationPath(), application);
|
||||
|
@ -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, getDBusInterface(QMetaType::fromType<InstanceAdaptor>()))) {
|
||||
if (registerObjectToDBus(service, objectPath, InstanceInterface)) {
|
||||
m_Instances.insert(QDBusObjectPath{objectPath}, QSharedPointer<InstanceService>{service});
|
||||
service->moveToThread(this->thread());
|
||||
adaptor->moveToThread(this->thread());
|
||||
|
@ -9,8 +9,7 @@ JobManager1Service::JobManager1Service(ApplicationManager1Service *parent)
|
||||
: m_parent(parent)
|
||||
{
|
||||
new JobManager1Adaptor{this};
|
||||
if (!registerObjectToDBus(
|
||||
this, DDEApplicationManager1JobManagerObjectPath, getDBusInterface(QMetaType::fromType<JobManager1Adaptor>()))) {
|
||||
if (!registerObjectToDBus(this, DDEApplicationManager1JobManagerObjectPath, JobManagerInterface)) {
|
||||
std::terminate();
|
||||
}
|
||||
qRegisterMetaType<LaunchTask>();
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
|
||||
auto *ptr = job.data();
|
||||
new JobAdaptor(ptr);
|
||||
if (!registerObjectToDBus(ptr, objectPath, getDBusInterface(QMetaType::fromType<JobAdaptor>()))) {
|
||||
if (!registerObjectToDBus(ptr, objectPath, JobInterface)) {
|
||||
qCritical() << "can't register job to dbus.";
|
||||
future.cancel();
|
||||
return {};
|
||||
|
Reference in New Issue
Block a user