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)