Changeset 12681


Ignore:
Timestamp:
Aug 13, 2011, 10:37:25 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) when building unordered lists, use g_slist_prepend() instead of g_slist_append() for efficiency's sake.

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r12677 r12681  
    560560
    561561    for( i=0; i<file_count; ++i )
    562         files = g_slist_append( files, f[i] );
     562        files = g_slist_prepend( files, f[i] );
    563563
    564564    open_files( files, gdata );
     
    809809
    810810    for( i=0; i<file_count; ++i )
    811         files = g_slist_append( files, g_file_new_for_uri( uris[i] ) );
     811        files = g_slist_prepend( files, g_file_new_for_uri( uris[i] ) );
    812812
    813813    open_files( files, gdata );
  • trunk/gtk/tr-prefs.c

    r12679 r12681  
    815815    gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
    816816    w = gtk_button_new_with_mnemonic( _( "_Open web client" ) );
    817     page->widgets = g_slist_append( page->widgets, w );
     817    page->widgets = g_slist_prepend( page->widgets, w );
    818818    g_signal_connect( w, "clicked", G_CALLBACK( onLaunchClutchCB ), NULL );
    819819    gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
     
    822822    /* port */
    823823    w = new_spin_button( TR_PREFS_KEY_RPC_PORT, core, 0, USHRT_MAX, 1 );
    824     page->widgets = g_slist_append( page->widgets, w );
     824    page->widgets = g_slist_prepend( page->widgets, w );
    825825    w = hig_workarea_add_row( t, &row, _( "HTTP _port:" ), w, NULL );
    826     page->widgets = g_slist_append( page->widgets, w );
     826    page->widgets = g_slist_prepend( page->widgets, w );
    827827
    828828    /* require authentication */
     
    831831    hig_workarea_add_wide_control( t, &row, w );
    832832    page->auth_tb = GTK_TOGGLE_BUTTON( w );
    833     page->widgets = g_slist_append( page->widgets, w );
     833    page->widgets = g_slist_prepend( page->widgets, w );
    834834    g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
    835835
     
    837837    s = _( "_Username:" );
    838838    w = new_entry( TR_PREFS_KEY_RPC_USERNAME, core );
    839     page->auth_widgets = g_slist_append( page->auth_widgets, w );
     839    page->auth_widgets = g_slist_prepend( page->auth_widgets, w );
    840840    w = hig_workarea_add_row( t, &row, s, w, NULL );
    841     page->auth_widgets = g_slist_append( page->auth_widgets, w );
     841    page->auth_widgets = g_slist_prepend( page->auth_widgets, w );
    842842
    843843    /* password */
     
    845845    w = new_entry( TR_PREFS_KEY_RPC_PASSWORD, core );
    846846    gtk_entry_set_visibility( GTK_ENTRY( w ), FALSE );
    847     page->auth_widgets = g_slist_append( page->auth_widgets, w );
     847    page->auth_widgets = g_slist_prepend( page->auth_widgets, w );
    848848    w = hig_workarea_add_row( t, &row, s, w, NULL );
    849     page->auth_widgets = g_slist_append( page->auth_widgets, w );
     849    page->auth_widgets = g_slist_prepend( page->auth_widgets, w );
    850850
    851851    /* require authentication */
     
    854854    hig_workarea_add_wide_control( t, &row, w );
    855855    page->whitelist_tb = GTK_TOGGLE_BUTTON( w );
    856     page->widgets = g_slist_append( page->widgets, w );
     856    page->widgets = g_slist_prepend( page->widgets, w );
    857857    g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
    858858
     
    873873                          G_CALLBACK( on_tree_view_button_released ), NULL );
    874874
    875         page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
     875        page->whitelist_widgets = g_slist_prepend( page->whitelist_widgets, w );
    876876        v = page->view = GTK_TREE_VIEW( w );
    877877        gtk_widget_set_tooltip_text( w, _( "IP addresses may use wildcards, such as 192.168.*.*" ) );
     
    901901        gtk_misc_set_alignment( GTK_MISC( w ), 0.0f, 0.0f );
    902902        gtk_misc_set_padding( GTK_MISC( w ), 0, GUI_PAD );
    903         page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
     903        page->whitelist_widgets = g_slist_prepend( page->whitelist_widgets, w );
    904904
    905905        h = gtk_hbox_new( TRUE, GUI_PAD );
     
    911911        gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
    912912        w = gtk_button_new_from_stock( GTK_STOCK_ADD );
    913         page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
     913        page->whitelist_widgets = g_slist_prepend( page->whitelist_widgets, w );
    914914        g_signal_connect( w, "clicked", G_CALLBACK( onAddWhitelistClicked ), page );
    915915        gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
     
    11001100        h = gtk_hbox_new( FALSE, 0 );
    11011101        w2 = new_time_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN );
    1102         page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
     1102        page->sched_widgets = g_slist_prepend( page->sched_widgets, w2 );
    11031103        gtk_box_pack_start( GTK_BOX( h ), w2, TRUE, TRUE, 0 );
    11041104        w2 = l = gtk_label_new_with_mnemonic ( _( " _to " ) );
    1105         page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
     1105        page->sched_widgets = g_slist_prepend( page->sched_widgets, w2 );
    11061106        gtk_box_pack_start( GTK_BOX( h ), w2, FALSE, FALSE, 0 );
    11071107        w2 = new_time_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_END );
    11081108        gtk_label_set_mnemonic_widget( GTK_LABEL( l ), w2 );
    1109         page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
     1109        page->sched_widgets = g_slist_prepend( page->sched_widgets, w2 );
    11101110        gtk_box_pack_start( GTK_BOX( h ), w2, TRUE, TRUE, 0 );
    11111111        w = new_check_button( s, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, core );
     
    11151115        s = _( "_On days:" );
    11161116        w = new_week_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_DAY );
    1117         page->sched_widgets = g_slist_append( page->sched_widgets, w );
     1117        page->sched_widgets = g_slist_prepend( page->sched_widgets, w );
    11181118        w = hig_workarea_add_row( t, &row, s, w, NULL );
    1119         page->sched_widgets = g_slist_append( page->sched_widgets, w );
     1119        page->sched_widgets = g_slist_prepend( page->sched_widgets, w );
    11201120
    11211121    hig_workarea_finish( t, &row );
Note: See TracChangeset for help on using the changeset viewer.