From 4b7827d42c1ce33a169683d041157d8a5c843fc4 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 14 Nov 2025 12:29:50 +0100 Subject: [PATCH] jfjoch_viewer: DBus fix --- viewer/JFJochViewerWindow.cpp | 4 +++- viewer/dbus/JFJochViewerAdaptor.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/viewer/JFJochViewerWindow.cpp b/viewer/JFJochViewerWindow.cpp index 196b1654e..d69a3757a 100644 --- a/viewer/JFJochViewerWindow.cpp +++ b/viewer/JFJochViewerWindow.cpp @@ -104,12 +104,14 @@ JFJochViewerWindow::JFJochViewerWindow(QWidget *parent, bool dbus, const QString menuBar->AddWindowEntry(calibrationWindow, "Calibration image viewer"); if (dbus) { + // Create adaptor attached to this window + new JFJochViewerAdaptor(this); QDBusConnection connection = QDBusConnection::sessionBus(); if (!connection.registerService("ch.psi.jfjoch_viewer")) { qWarning("Failed to register D-Bus service: %s", qPrintable(connection.lastError().message())); } else { - if (!connection.registerObject("/", this)) { + if (!connection.registerObject("/", this, QDBusConnection::ExportAdaptors)) { qFatal("Failed to register D-Bus object: %s", qPrintable(connection.lastError().message())); } } diff --git a/viewer/dbus/JFJochViewerAdaptor.cpp b/viewer/dbus/JFJochViewerAdaptor.cpp index 1cb9cdd88..71a656633 100644 --- a/viewer/dbus/JFJochViewerAdaptor.cpp +++ b/viewer/dbus/JFJochViewerAdaptor.cpp @@ -3,7 +3,6 @@ #include "JFJochViewerAdaptor.h" - void JFJochViewerAdaptor::LoadFile(const QString &filename, int image_number, int summation) { // Your logic to handle the filename // Forward to parent (JFJochViewerWindow)