On Sat, Jun 02, 2012 at 07:33:08PM +0300, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gconfig/libvirt-gconfig-domain.c | 33 ++++++++++++++++++++++++++++++
libvirt-gconfig/libvirt-gconfig-domain.h | 2 ++
libvirt-gconfig/libvirt-gconfig.sym | 2 ++
3 files changed, 37 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c
b/libvirt-gconfig/libvirt-gconfig-domain.c
index 7477400..d5a676a 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -39,6 +39,7 @@ G_DEFINE_TYPE(GVirConfigDomain, gvir_config_domain,
GVIR_CONFIG_TYPE_OBJECT);
enum {
PROP_0,
PROP_NAME,
+ PROP_TITLE,
PROP_DESCRIPTION,
PROP_MEMORY,
PROP_VCPU,
@@ -56,6 +57,9 @@ static void gvir_config_domain_get_property(GObject *object,
case PROP_NAME:
g_value_set_string(value, gvir_config_domain_get_name(domain));
break;
+ case PROP_TITLE:
+ g_value_set_string(value, gvir_config_domain_get_title(domain));
+ break;
case PROP_DESCRIPTION:
g_value_set_string(value, gvir_config_domain_get_description(domain));
break;
@@ -85,6 +89,9 @@ static void gvir_config_domain_set_property(GObject *object,
case PROP_NAME:
gvir_config_domain_set_name(domain, g_value_get_string(value));
break;
+ case PROP_TITLE:
+ gvir_config_domain_set_title(domain, g_value_get_string(value));
+ break;
case PROP_DESCRIPTION:
gvir_config_domain_set_description(domain, g_value_get_string(value));
break;
@@ -121,6 +128,14 @@ static void gvir_config_domain_class_init(GVirConfigDomainClass
*klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
+ PROP_TITLE,
+ g_param_spec_string("title",
+ "Title",
+ "A short description -
title - of the domain",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property(object_class,
PROP_DESCRIPTION,
g_param_spec_string("description",
"Description",
@@ -216,6 +231,12 @@ const char *gvir_config_domain_get_name(GVirConfigDomain *domain)
"name");
}
+const char *gvir_config_domain_get_title(GVirConfigDomain *domain)
+{
+ return gvir_config_object_get_node_content(GVIR_CONFIG_OBJECT(domain),
+ "title");
+}
+
/**
* gvir_config_domain_set_name:
* @domain: a #GVirConfigDomain
@@ -228,6 +249,18 @@ void gvir_config_domain_set_name(GVirConfigDomain *domain, const
char *name)
g_object_notify(G_OBJECT(domain), "name");
}
+/**
+ * gvir_config_domain_set_title:
+ * @domain: a #GVirConfigDomain
+ * @title: (allow-none):
ACK with some doc added there, something like:
title: title of the domain
Sets the title of the domain. This is an optional short textual description of the domain.
Passing a NULL @title
unsets the current domain title.
Christophe