[virt-tools-list] [PATCH virt-viewer 8/9] Small code simplification

Marc-André Lureau marcandre.lureau at gmail.com
Wed Feb 15 00:29:59 UTC 2012


---
 src/virt-viewer-app.c    |   14 +++-----------
 src/virt-viewer-app.h    |    3 ---
 src/virt-viewer-window.c |    4 ++--
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 630394c..97639a1 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -467,8 +467,8 @@ static void set_usb_options_sensitive(gpointer key G_GNUC_UNUSED,
                                       gpointer value,
                                       gpointer user_data)
 {
-    virt_viewer_window_set_usb_options_sensitive(
-                                                 VIRT_VIEWER_WINDOW(value), GPOINTER_TO_INT(user_data));
+    virt_viewer_window_set_usb_options_sensitive(VIRT_VIEWER_WINDOW(value),
+                                                 GPOINTER_TO_INT(user_data));
 }
 
 static void
@@ -1347,6 +1347,7 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass)
                                                          G_PARAM_READABLE |
                                                          G_PARAM_WRITABLE |
                                                          G_PARAM_STATIC_STRINGS));
+
     g_object_class_install_property(object_class,
                                     PROP_TITLE,
                                     g_param_spec_string("title",
@@ -1686,15 +1687,6 @@ virt_viewer_app_get_windows(VirtViewerApp *self)
     return self->priv->windows;
 }
 
-void virt_viewer_app_usb_device_selection(VirtViewerApp   *self,
-                                          GtkWindow       *parent)
-{
-    g_return_if_fail(VIRT_VIEWER_IS_APP(self));
-    g_return_if_fail(self->priv->session != NULL);
-
-    virt_viewer_session_usb_device_selection(self->priv->session, parent);
-}
-
 /*
  * Local variables:
  *  c-indent-level: 4
diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
index 3e48953..5dc95dd 100644
--- a/src/virt-viewer-app.h
+++ b/src/virt-viewer-app.h
@@ -91,9 +91,6 @@ gboolean virt_viewer_app_window_set_visible(VirtViewerApp *self, VirtViewerWindo
 void virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...);
 void virt_viewer_app_show_display(VirtViewerApp *self);
 GHashTable* virt_viewer_app_get_windows(VirtViewerApp *self);
-
-void virt_viewer_app_usb_device_selection(VirtViewerApp   *self,
-                                          GtkWindow       *parent);
 gboolean virt_viewer_app_get_enable_accel(VirtViewerApp *self);
 VirtViewerSession* virt_viewer_app_get_session(VirtViewerApp *self);
 
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 5318bff..78adb74 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -766,8 +766,8 @@ G_MODULE_EXPORT void
 virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu G_GNUC_UNUSED,
                                                   VirtViewerWindow *self)
 {
-    virt_viewer_app_usb_device_selection(self->priv->app,
-                                         GTK_WINDOW(self->priv->window));
+    virt_viewer_session_usb_device_selection(virt_viewer_app_get_session(self->priv->app),
+                                             GTK_WINDOW(self->priv->window));
 }
 
 G_MODULE_EXPORT void
-- 
1.7.7.6




More information about the virt-tools-list mailing list