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:
parent
5363c7d89b
commit
fb62c8bbdc
1 changed files with 5 additions and 19 deletions
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue