From a0a211c41e843748119bcf3c16adaa78f76962d8 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Fri, 10 May 2024 05:27:26 +0000 Subject: [PATCH] sync: from linuxdeepin/qt5integration Synchronize source files from linuxdeepin/qt5integration. Source-pull-request: https://github.com/linuxdeepin/qt5integration/pull/219 --- platformthemeplugin/qdeepinfiledialoghelper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platformthemeplugin/qdeepinfiledialoghelper.cpp b/platformthemeplugin/qdeepinfiledialoghelper.cpp index 03d2f59..be51637 100644 --- a/platformthemeplugin/qdeepinfiledialoghelper.cpp +++ b/platformthemeplugin/qdeepinfiledialoghelper.cpp @@ -360,9 +360,18 @@ void QDeepinFileDialogHelper::initDBusFileDialogManager() } else { dialogService = DIALOG_SERVICE; } + + const auto *managerObjectPath = "/com/deepin/filemanager/filedialogmanager"; + auto conn = QDBusConnection::sessionBus(); + auto reply = conn.call(QDBusMessage::createMethodCall(dialogService, managerObjectPath , "org.freedesktop.DBus.Peer", "Ping")); + + if(reply.type() != QDBusMessage::ReplyMessage) { + qCWarning(fileDialogHelper) << reply.errorMessage(); + } + if (QDBusConnection::sessionBus().interface()->isServiceRegistered(dialogService).value() || !QStandardPaths::findExecutable("dde-desktop").isEmpty()) { - manager = new DFileDialogManager(dialogService, "/com/deepin/filemanager/filedialogmanager", QDBusConnection::sessionBus()); + manager = new DFileDialogManager(dialogService, managerObjectPath, QDBusConnection::sessionBus()); } }