[libgovirt] Emit 'notify' signal when cdrom filename changes
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgovirt] Emit 'notify' signal when cdrom filename changes
- Date: Thu, 26 Jun 2014 23:22:20 +0000 (UTC)
commit cf395f57547faf1c45a6073e0cd567d6827e1d91
Author: Christophe Fergeau <cfergeau redhat com>
Date: Thu May 22 12:51:35 2014 +0200
Emit 'notify' signal when cdrom filename changes
govirt/ovirt-cdrom.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/govirt/ovirt-cdrom.c b/govirt/ovirt-cdrom.c
index e842e10..ff46ff6 100644
--- a/govirt/ovirt-cdrom.c
+++ b/govirt/ovirt-cdrom.c
@@ -101,8 +101,11 @@ static gboolean ovirt_cdrom_refresh_from_xml(OvirtCdrom *cdrom,
file_node = g_hash_table_lookup(node->children, file_key);
if (file_node != NULL) {
file = rest_xml_node_get_attr(file_node, "id");
- g_free(cdrom->priv->file);
- cdrom->priv->file = g_strdup(file);
+ if (g_strcmp0(file, cdrom->priv->file) != 0) {
+ g_free(cdrom->priv->file);
+ cdrom->priv->file = g_strdup(file);
+ g_object_notify(G_OBJECT(cdrom), "file");
+ }
}
g_object_get(G_OBJECT(cdrom), "name", &name, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]