[virt-tools-list] [PATCH virt-viewer 17/25] Add virt_viewer_window_get_display()
Marc-André Lureau
marcandre.lureau at gmail.com
Tue Jul 17 19:24:59 UTC 2012
Getter used in following changes.
---
src/virt-viewer-window.c | 13 +++++++++++--
src/virt-viewer-window.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 46e44be..4bc427a 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -112,7 +112,8 @@ static void
virt_viewer_window_get_property (GObject *object, guint property_id,
GValue *value, GParamSpec *pspec)
{
- VirtViewerWindowPrivate *priv = VIRT_VIEWER_WINDOW(object)->priv;
+ VirtViewerWindow *self = VIRT_VIEWER_WINDOW(object);
+ VirtViewerWindowPrivate *priv = self->priv;
switch (property_id) {
case PROP_SUBTITLE:
@@ -124,7 +125,7 @@ virt_viewer_window_get_property (GObject *object, guint property_id,
break;
case PROP_DISPLAY:
- g_value_set_object(value, priv->display);
+ g_value_set_object(value, virt_viewer_window_get_display(self));
break;
case PROP_CONTAINER:
@@ -1117,6 +1118,14 @@ virt_viewer_window_get_builder(VirtViewerWindow *self)
return self->priv->builder;
}
+VirtViewerDisplay*
+virt_viewer_window_get_display(VirtViewerWindow *self)
+{
+ g_return_val_if_fail(VIRT_VIEWER_WINDOW(self), FALSE);
+
+ return self->priv->display;
+}
+
/*
* Local variables:
* c-indent-level: 4
diff --git a/src/virt-viewer-window.h b/src/virt-viewer-window.h
index f80c4c7..44db585 100644
--- a/src/virt-viewer-window.h
+++ b/src/virt-viewer-window.h
@@ -63,6 +63,7 @@ GType virt_viewer_window_get_type (void);
GtkWindow* virt_viewer_window_get_window (VirtViewerWindow* window);
VirtViewerNotebook* virt_viewer_window_get_notebook (VirtViewerWindow* window);
void virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *display);
+VirtViewerDisplay* virt_viewer_window_get_display(VirtViewerWindow *self);
void virt_viewer_window_set_usb_options_sensitive(VirtViewerWindow *self, gboolean sensitive);
void virt_viewer_window_update_title(VirtViewerWindow *self);
void virt_viewer_window_show(VirtViewerWindow *self);
--
1.7.10.4
More information about the virt-tools-list
mailing list