Changeset 9503


Ignore:
Timestamp:
Nov 9, 2009, 6:58:18 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) possible fix for "open folder" in single-file torrents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-torrent.c

    r9502 r9503  
    291291tr_torrent_open_folder( TrTorrent * gtor )
    292292{
    293     tr_torrent * tor = tr_torrent_handle( gtor );
    294     gtr_open_file( tr_torrentGetCurrentDir( tor ) );
    295 }
     293    const tr_torrent * tor =  tr_torrent_handle( gtor );
     294    const tr_info * info = tr_torrent_info( gtor );
     295    const gboolean single = info->fileCount == 1;
     296    char * path = single ? g_build_filename( tr_torrentGetCurrentDir( tor ), NULL )
     297                         : g_build_filename( tr_torrentGetCurrentDir( tor ), info->name, NULL );
     298    gtr_open_file( path );
     299    g_free( path );
     300}
Note: See TracChangeset for help on using the changeset viewer.