[dbus PATCH v2 7/9] Remove reason to string translation in virtDBusEventsDomainTrayChange

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Domain.xml |  2 +-
 src/events.c                | 15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 6448a46..98c018c 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -578,7 +578,7 @@
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback"/>
       <arg name="device" type="s"/>
-      <arg name="reason" type="s"/>
+      <arg name="reason" type="u"/>
     </signal>
   </interface>
 </node>
diff --git a/src/events.c b/src/events.c
index 1b584f7..d4c7145 100644
--- a/src/events.c
+++ b/src/events.c
@@ -80,28 +80,15 @@ virtDBusEventsDomainTrayChange(virConnectPtr connection G_GNUC_UNUSED,
 {
     virtDBusConnect *connect = opaque;
     g_autofree gchar *path = NULL;
-    const gchar *reasonstr;
 
     path = virtDBusUtilBusPathForVirDomain(domain, connect->domainPath);
 
-    switch (reason) {
-    case VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN:
-        reasonstr = "open";
-        break;
-    case VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE:
-        reasonstr = "close";
-        break;
-    default:
-        reasonstr = "";
-        break;
-    }
-
     g_dbus_connection_emit_signal(connect->bus,
                                   NULL,
                                   path,
                                   VIRT_DBUS_DOMAIN_INTERFACE,
                                   "TrayChange",
-                                  g_variant_new("(ss)", device, reasonstr),
+                                  g_variant_new("(su)", device, reason),
                                   NULL);
 
     return 0;
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux