Changeset 5231


Ignore:
Timestamp:
Mar 9, 2008, 7:02:16 PM (14 years ago)
Author:
charles
Message:

(gtk) notify: in glib >= 2.16, use g_app_info_launch_default_for_uri() to open the completed torrent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/notify.c

    r5219 r5231  
    1111 */
    1212
     13#ifdef HAVE_GIO
     14#include <gio/gio.h>
     15#endif
    1316#include <glib/gi18n.h>
    1417#include "notify.h"
     
    5659    if( path )
    5760    {
    58         char * argv[] = { "xdg-open", path, NULL };
    59         g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL );
     61        gboolean opened = FALSE;
     62#ifdef HAVE_GIO
     63        GFile * file = g_file_new_for_path( path );
     64        char * uri = g_file_get_uri( file );
     65        opened = g_app_info_launch_default_for_uri( uri, NULL, NULL );
     66        g_free( uri );
     67        g_object_unref( G_OBJECT( file ) );
     68#endif
     69        if( !opened ) {
     70            char * argv[] = { "xdg-open", path, NULL };
     71            g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL );
     72        }
    6073        g_free( path );
    6174    }
Note: See TracChangeset for help on using the changeset viewer.