Changeset 9581


Ignore:
Timestamp:
Nov 26, 2009, 4:57:26 AM (13 years ago)
Author:
charles
Message:

(trunk gtk) #2608 "Add URLs by drag-and-drop" - add support for dragging magnet URLs and .torrent file URLs onto the GTK+ client.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r9545 r9581  
    807807
    808808            /* walk past "file://", if present */
    809             if( g_str_has_prefix( filename, "file:" ) )
    810             {
     809            if( g_str_has_prefix( filename, "file:" ) ) {
    811810                filename += 5;
    812811                while( g_str_has_prefix( filename, "//" ) )
     
    814813            }
    815814
    816             /* if the file doesn't exist, the first part
    817                might be a hostname ... walk past it. */
    818             if( !g_file_test( filename, G_FILE_TEST_EXISTS ) )
    819             {
    820                 char * pch = strchr( filename + 1, '/' );
    821                 if( pch != NULL )
    822                     filename = pch;
    823             }
    824 
    825             /* finally, add it to the list of torrents to try adding */
     815            g_debug( "got from drag: [%s]", filename );
     816
    826817            if( g_file_test( filename, G_FILE_TEST_EXISTS ) )
    827818                paths = g_slist_prepend( paths, g_strdup( filename ) );
     819            else
     820                tr_core_add_from_url( data->core, filename );
    828821        }
    829822
Note: See TracChangeset for help on using the changeset viewer.