summary refs log tree commit diff
path: root/src/dbus/NhekoDBusBackend.h
diff options
context:
space:
mode:
authorLoren Burkholder <55629213+LorenDB@users.noreply.github.com>2022-04-18 12:50:15 -0400
committerGitHub <noreply@github.com>2022-04-18 16:50:15 +0000
commitda6b3eb8f44f9257aa7f7eb1b0e6a1b2f20cd0a5 (patch)
treea4b5da31b3587d104ac8dd93e6237fa581d7719d /src/dbus/NhekoDBusBackend.h
parentMerge pull request #1046 from tastytea/zsh-completion (diff)
downloadnheko-da6b3eb8f44f9257aa7f7eb1b0e6a1b2f20cd0a5.tar.xz
D-Bus fixes (#1048)
According to LorenDB's First Law of Software Development, once a developer has committed or merged a new feature, he will find at least one problem with the implementation.

I realized that I was constructing the room info items with some parameters out of order, which required a rather urgent fix. Furthermore, I fixed the image decoding algorithms in the QDBusArgument operator. Finally, I switched the API version parameter back to QString, since passing it as a QVersionNumber would create a problem for non-Qt API users.

On the general improvements side of things, I added some handy wrappers for D-Bus calls so that other devs that copy the NhekoDBusApi files to use for their own applications won't have to go to the effort of making the D-Bus calls themselves.
Diffstat (limited to '')
-rw-r--r--src/dbus/NhekoDBusBackend.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dbus/NhekoDBusBackend.h b/src/dbus/NhekoDBusBackend.h
index 02fd87d5..05d686ca 100644
--- a/src/dbus/NhekoDBusBackend.h
+++ b/src/dbus/NhekoDBusBackend.h
@@ -23,18 +23,18 @@ public:
 
 public slots:
     //! Get the nheko D-Bus API version.
-    Q_SCRIPTABLE QVersionNumber apiVersion() const { return nheko::dbus::apiVersion; }
+    Q_SCRIPTABLE QString apiVersion() const { return nheko::dbus::dbusApiVersion.toString(); }
     //! Get the nheko version.
-    Q_SCRIPTABLE QString nhekoVersionString() const { return nheko::version; }
+    Q_SCRIPTABLE QString nhekoVersion() const { return nheko::version; }
     //! Call this function to get a list of all joined rooms.
-    Q_SCRIPTABLE QVector<nheko::dbus::RoomInfoItem> getRooms(const QDBusMessage &message);
+    Q_SCRIPTABLE QVector<nheko::dbus::RoomInfoItem> rooms(const QDBusMessage &message);
     //! Activates a currently joined room.
     Q_SCRIPTABLE void activateRoom(const QString &alias) const;
     //! Joins a room. It is your responsibility to ask for confirmation (if desired).
     Q_SCRIPTABLE void joinRoom(const QString &alias) const;
     //! Starts or activates a direct chat. It is your responsibility to ask for confirmation (if
     //! desired).
-    Q_SCRIPTABLE void startDirectChat(const QString &userId) const;
+    Q_SCRIPTABLE void directChat(const QString &userId) const;
 
 private:
     void bringWindowToTop() const;