Changeset 12511


Ignore:
Timestamp:
Jun 24, 2011, 6:16:12 PM (10 years ago)
Author:
jordan
Message:

(trunk gtk) #4308 "Open with Transmission from Firefox doesn't work since Transmission 2.31" -- added support for uri-formmatted filenames being passed in via the command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r12461 r12511  
    585585    for( i=0; i<argc; ++i )
    586586    {
    587         if( gtr_is_supported_url( argv[i] ) || gtr_is_magnet_link( argv[i] ) )
     587        const char * arg = argv[i];
     588
     589        if( gtr_is_supported_url( arg ) || gtr_is_magnet_link( arg ) )
    588590        {
    589             ret = g_slist_prepend( ret, g_strdup( argv[i] ) );
     591            ret = g_slist_prepend( ret, g_strdup( arg ) );
    590592        }
    591593        else /* local file */
    592594        {
    593             char * filename = g_path_is_absolute( argv[i] )
    594                             ? g_strdup ( argv[i] )
    595                             : g_build_filename( pwd, argv[i], NULL );
     595            char * filename;
     596
     597            if( g_path_is_absolute( arg ) )
     598                filename = g_strdup( arg );
     599            else {
     600                filename = g_filename_from_uri( arg, NULL, NULL );
     601
     602                if( filename == NULL )
     603                    filename = g_build_filename( pwd, arg, NULL );
     604            }
    596605
    597606            if( g_file_test( filename, G_FILE_TEST_EXISTS ) )
Note: See TracChangeset for help on using the changeset viewer.