[virt-tools-list] [PATCH virt-viewer 2/7] recent: get mime type from session

Christophe Fergeau cfergeau at redhat.com
Tue Nov 27 09:56:19 UTC 2012


ACK.


On Fri, Nov 23, 2012 at 01:41:07PM +0100, Marc-André Lureau wrote:
> Do not use spice mime type for all kind of sessions, but depending on
> what is actually being used.
> ---
>  src/remote-viewer-main.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c
> index 704c615..053e146 100644
> --- a/src/remote-viewer-main.c
> +++ b/src/remote-viewer-main.c
> @@ -158,20 +158,18 @@ static gint connect_dialog(gchar **uri)
>  }
>  
>  static void
> -recent_add(gchar *uri)
> +recent_add(gchar *uri, const gchar *mime_type)
>  {
>      GtkRecentManager *recent;
>      GtkRecentData meta = {
> -        .mime_type    = (char*)"application/x-spice",
>          .app_name     = (char*)"remote-viewer",
>          .app_exec     = (char*)"remote-viewer %u",
> +        .mime_type    = mime_type,
>      };
>  
>      if (uri == NULL)
>          return;
>  
> -    g_return_if_fail(g_str_has_prefix(uri, "spice://") || g_str_has_prefix(uri, "vnc://"));
> -
>      recent = gtk_recent_manager_get_default();
>      meta.display_name = uri;
>      if (!gtk_recent_manager_add_full(recent, uri, &meta))
> @@ -182,8 +180,9 @@ static void connected(VirtViewerSession *session,
>                        VirtViewerApp *self G_GNUC_UNUSED)
>  {
>      gchar *uri = virt_viewer_session_get_uri(session);
> +    const gchar *mime = virt_viewer_session_mime_type(session);
>  
> -    recent_add(uri);
> +    recent_add(uri, mime);
>      g_free(uri);
>  }
>  
> -- 
> 1.7.11.7
> 
> _______________________________________________
> 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/20121127/06149fd3/attachment.sig>


More information about the virt-tools-list mailing list