Changeset 5020


Ignore:
Timestamp:
Feb 13, 2008, 3:57:48 AM (14 years ago)
Author:
charles
Message:

(gtk) add some safety assertions

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r5015 r5020  
    142142    gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( wind ), TRUE );
    143143    gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( wind ), FALSE );
    144     tr_ctorGetDestination( ctor, TR_FORCE, &str );
     144    if( tr_ctorGetDestination( ctor, TR_FORCE, &str ) )
     145        g_assert_not_reached( );
    145146    gtk_file_chooser_set_uri( GTK_FILE_CHOOSER( wind ), str );
    146147
    147148    v = gtk_vbox_new( FALSE, GUI_PAD );
    148149
     150        flag = 0;
    149151        w = gtk_check_button_new_with_mnemonic( _( "_Delete original torrent file" ) );
    150152        g_signal_connect( w, "toggled", G_CALLBACK( deleteToggled ), ctor );
    151         tr_ctorGetDeleteSource( ctor, &flag );
     153        if( tr_ctorGetDeleteSource( ctor, &flag ) )
     154            g_assert_not_reached( );
    152155        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), flag );
    153156        gtk_box_pack_start( GTK_BOX( v ), w, FALSE, FALSE, 0 );
    154157
     158        flag = 1;
    155159        w = gtk_check_button_new_with_mnemonic( _( "_Start when added" ) );
    156160        g_signal_connect( w, "toggled", G_CALLBACK( startToggled ), ctor );
    157         tr_ctorGetPaused( ctor, TR_FORCE, &flag );
     161        if( tr_ctorGetPaused( ctor, TR_FORCE, &flag ) )
     162            g_assert_not_reached( );
    158163        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), !flag );
    159164        gtk_box_pack_start( GTK_BOX( v ), w, FALSE, FALSE, 0 );
  • trunk/gtk/open.c

    r5015 r5020  
    146146                                     NULL );
    147147
    148     tr_ctorGetDestination( ctor, TR_FORCE, &str );
     148    if( tr_ctorGetDestination( ctor, TR_FORCE, &str ) )
     149        g_assert_not_reached( );
    149150    data = g_new0( struct OpenData, 1 );
    150151    data->core = core;
     
    207208    col = 0;
    208209    w = gtk_check_button_new_with_mnemonic( _( "_Delete original torrent file" ) );
    209     tr_ctorGetDeleteSource( ctor, &flag );
     210    if( tr_ctorGetDeleteSource( ctor, &flag ) )
     211        g_assert_not_reached( );
    210212    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), flag );
    211213    gtk_table_attach( GTK_TABLE( t ), w, col, col+2, row, row+1, GTK_FILL, 0, 0, 0 );
     
    215217    w = gtk_check_button_new_with_mnemonic( _( "_Start when added" ) );
    216218    data->run_check = w;
    217     tr_ctorGetPaused( ctor, TR_FORCE, &flag );
     219    if( tr_ctorGetPaused( ctor, TR_FORCE, &flag ) )
     220        g_assert_not_reached( );
    218221    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), !flag );
    219222    gtk_table_attach( GTK_TABLE( t ), w, col, col+2, row, row+1, GTK_FILL, 0, 0, 0 );
Note: See TracChangeset for help on using the changeset viewer.