1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(trunk gtk) #3033 "wrong calls to GtkFileChooserDialog" -- fix minor regression in the 'add torrent' dialog caused by r10340

This commit is contained in:
Charles Kerr 2010-03-12 00:17:35 +00:00
parent 5363c7d89b
commit fb62c8bbdc

View file

@ -155,6 +155,7 @@ updateTorrent( struct AddData * o )
tr_torrent * tor = tr_torrent_handle( o->gtor ); tr_torrent * tor = tr_torrent_handle( o->gtor );
tr_torrentSetDownloadDir( tor, o->downloadDir ); tr_torrentSetDownloadDir( tor, o->downloadDir );
file_list_set_torrent( o->list, tr_torrentId( tor ) ); file_list_set_torrent( o->list, tr_torrentId( tor ) );
tr_torrentVerify( tor );
} }
} }
@ -166,12 +167,10 @@ updateTorrent( struct AddData * o )
* metadata when that happens. * metadata when that happens.
*/ */
static void static void
sourceChanged( GtkFileChooserButton * b, sourceChanged( GtkFileChooserButton * b, gpointer gdata )
gpointer gdata )
{ {
struct AddData * data = gdata; struct AddData * data = gdata;
char * filename = gtk_file_chooser_get_filename( char * filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
GTK_FILE_CHOOSER( b ) );
/* maybe instantiate a torrent */ /* maybe instantiate a torrent */
if( data->filename || !data->gtor ) if( data->filename || !data->gtor )
@ -210,29 +209,16 @@ sourceChanged( GtkFileChooserButton * b,
} }
static void static void
verifyRequested( GtkButton * button UNUSED, gpointer gdata ) downloadDirChanged( GtkFileChooserButton * b, gpointer gdata )
{ {
struct AddData * data = gdata; struct AddData * data = gdata;
char * fname = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) );
if( data->gtor )
tr_torrentVerify( tr_torrent_handle( data->gtor ) );
}
static void
downloadDirChanged( GtkFileChooserButton * b,
gpointer gdata )
{
char * fname = gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER( b ) );
struct AddData * data = gdata;
if( fname && ( !data->downloadDir || strcmp( fname, data->downloadDir ) ) ) if( fname && ( !data->downloadDir || strcmp( fname, data->downloadDir ) ) )
{ {
g_free( data->downloadDir ); g_free( data->downloadDir );
data->downloadDir = g_strdup( fname ); data->downloadDir = g_strdup( fname );
updateTorrent( data ); updateTorrent( data );
verifyRequested( NULL, data );
} }
g_free( fname ); g_free( fname );