[virt-tools-list] [PATCH virt-viewer 09/19] Rebuild display menu when a window is added or removed
Christophe Fergeau
cfergeau at redhat.com
Tue Jul 17 09:24:54 UTC 2012
Makes sense, ACK
However, I'm worried by the way VirtViewerApp uses hash tables,
virt_viewer_app_update_menu_displays calls g_list_sort and then g_list_free on
the list returned by g_hash_table_get_keys while this list should not be
modified (I'm assuming g_list_sort does the sorting in place and does not
create a new list). Keys to the 'windows' hash table should also be using
GUINT_TO_POINTER. I can send patches for this after this series gets in.
Christophe
On Mon, Jul 16, 2012 at 06:57:44PM +0200, Marc-André Lureau wrote:
> ---
> src/virt-viewer-app.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 03cf4b4..758cfe9 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -520,6 +520,7 @@ virt_viewer_app_remove_nth_window(VirtViewerApp *self, gint nth)
> DEBUG_LOG("Remove window %d %p", nth, win);
> removed = g_hash_table_steal(self->priv->windows, &nth);
> g_warn_if_fail(removed);
> + virt_viewer_app_update_menu_displays(self);
>
> if (removed)
> g_signal_emit(self, signals[SIGNAL_WINDOW_REMOVED], 0, win);
> @@ -540,6 +541,7 @@ virt_viewer_app_set_nth_window(VirtViewerApp *self, gint nth, VirtViewerWindow *
> DEBUG_LOG("Insert window %d %p", nth, win);
> g_hash_table_insert(self->priv->windows, key, win);
> virt_viewer_app_set_window_subtitle(self, win, nth);
> + virt_viewer_app_update_menu_displays(self);
>
> g_signal_emit(self, signals[SIGNAL_WINDOW_ADDED], 0, win);
> }
> --
> 1.7.10.4
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20120717/8876abf8/attachment.sig>
More information about the virt-tools-list
mailing list