Ticket #1585: timeout_add_seconds.patch

File timeout_add_seconds.patch, 5.4 KB (added by andrewsomething, 13 years ago)
  • gtk/details.c

    === modified file 'gtk/details.c'
     
    2828#include "hig.h"
    2929#include "util.h"
    3030
    31 #define UPDATE_INTERVAL_MSEC 2000
     31#define UPDATE_INTERVAL_SEC 2
    3232
    3333/****
    3434*****  PIECES VIEW
     
    15331533
    15341534    gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), n, TRUE, TRUE, 0 );
    15351535
    1536     tag = g_timeout_add ( UPDATE_INTERVAL_MSEC, periodic_refresh, d );
     1536    tag = g_timeout_add_seconds ( UPDATE_INTERVAL_SEC, periodic_refresh, d );
    15371537    g_object_set_data_full ( G_OBJECT( d ), "tag",
    15381538                             GUINT_TO_POINTER( tag ), remove_tag );
    15391539
  • gtk/file-list.c

    === modified file 'gtk/file-list.c'
     
    483483
    484484        refresh( data );
    485485
    486         data->timeout_tag = g_timeout_add( 2500, refreshModel, data );
     486        data->timeout_tag = g_timeout_add_seconds( 2.5, refreshModel, data );
    487487    }
    488488
    489489    gtk_tree_view_set_model( GTK_TREE_VIEW( data->view ),
  • gtk/main.c

    === modified file 'gtk/main.c'
     
    6868#include <libtransmission/version.h>
    6969
    7070/* interval in milliseconds to update the torrent list display */
    71 #define UPDATE_INTERVAL         1666
     71#define UPDATE_INTERVAL         1.666
    7272
    7373/* interval in milliseconds to check for stopped torrents and update display */
    7474#define EXIT_CHECK_INTERVAL     500
     
    647647    prefschanged( cbdata->core, PREF_KEY_SHOW_TRAY_ICON, cbdata );
    648648
    649649    /* start model update timer */
    650     cbdata->timer = g_timeout_add( UPDATE_INTERVAL, updatemodel, cbdata );
     650    cbdata->timer = g_timeout_add_seconds( UPDATE_INTERVAL, updatemodel, cbdata );
    651651    updatemodel( cbdata );
    652652
    653653    /* start scheduled rate timer */
    654654    updateScheduledLimits ( tr_core_session( cbdata->core ) );
    655     g_timeout_add( 60 * 1000, updateScheduledLimits,
     655    g_timeout_add_seconds( 60 , updateScheduledLimits,
    656656                  tr_core_session( cbdata->core ) );
    657657
    658658    /* either show the window or iconify it */
     
    730730        gtk_window_get_position( window, &x, &y );
    731731        clearTag( &cbdata->idle_hide_mainwindow_tag );
    732732        hideMainWindow( cbdata );
    733         cbdata->idle_hide_mainwindow_tag = g_timeout_add(
    734             100, idle_hide_mainwindow, window );
     733        cbdata->idle_hide_mainwindow_tag = g_timeout_add_seconds(
     734            .1, idle_hide_mainwindow, window );
    735735    }
    736736    else
    737737    {
  • gtk/msgwin.c

    === modified file 'gtk/msgwin.c'
     
    543543    gtk_box_pack_start( GTK_BOX( vbox ), w, TRUE, TRUE, 0 );
    544544    gtk_container_add( GTK_CONTAINER( win ), vbox );
    545545
    546     data->refresh_tag = g_timeout_add( 1666, onRefresh, data );
     546    data->refresh_tag = g_timeout_add_seconds( 1.666, onRefresh, data );
    547547    g_object_weak_ref( G_OBJECT( win ), onWindowDestroyed, data );
    548548
    549549    gtk_widget_show_all( win );
  • gtk/stats.c

    === modified file 'gtk/stats.c'
     
    169169    updateStats( ui );
    170170    g_object_set_data_full( G_OBJECT( d ), "data", ui, g_free );
    171171    g_signal_connect( d, "response", G_CALLBACK( dialogResponse ), ui );
    172     i = g_timeout_add( 1000, updateStats, ui );
     172    i = g_timeout_add_seconds( 1, updateStats, ui );
    173173    g_object_weak_ref( G_OBJECT( d ), dialogDestroyed, GUINT_TO_POINTER( i ) );
    174174    return d;
    175175}
  • gtk/tr-core.c

    === modified file 'gtk/tr-core.c'
     
    499499            p->monitor_files =
    500500                g_slist_append( p->monitor_files, g_strdup( filename ) );
    501501        if( !p->monitor_idle_tag )
    502             p->monitor_idle_tag = g_timeout_add( 1000, watchFolderIdle,
     502            p->monitor_idle_tag = g_timeout_add_seconds( 1, watchFolderIdle,
    503503                                                 core );
    504504    }
    505505}
  • gtk/tr-icon.c

    === modified file 'gtk/tr-icon.c'
     
    2626
    2727#else
    2828
    29  #define UPDATE_INTERVAL 2500
     29 #define UPDATE_INTERVAL 2.5
    3030
    3131static void
    3232activated( GtkStatusIcon   * self      UNUSED,
     
    9090
    9191    g_signal_connect( icon, "activate", G_CALLBACK( activated ), NULL );
    9292    g_signal_connect( icon, "popup-menu", G_CALLBACK( popup ), NULL );
    93     id = g_timeout_add( UPDATE_INTERVAL, refresh_tooltip_cb, icon );
     93    id = g_timeout_add_seconds( UPDATE_INTERVAL, refresh_tooltip_cb, icon );
    9494    g_object_set_data( G_OBJECT( icon ), "tr-core", core );
    9595    g_object_set_data_full( G_OBJECT(
    9696                                icon ), "update-tag", GUINT_TO_POINTER(
  • gtk/tr-prefs.c

    === modified file 'gtk/tr-prefs.c'
     
    251251        data->last_change = g_timer_new( );
    252252        g_object_set_data_full( o, IDLE_DATA, data, spin_idle_data_free );
    253253        g_object_ref( G_OBJECT( o ) );
    254         g_timeout_add( 100, spun_cb_idle, w );
     254        g_timeout_add_seconds( .1, spun_cb_idle, w );
    255255    }
    256256    g_timer_start( data->last_change );
    257257}
     
    13101310        data = g_new0( struct test_port_data, 1 );
    13111311        data->label = ndata->label;
    13121312        data->alive = ndata->alive;
    1313         g_timeout_add( 3000, testing_port_begin, data );
     1313        g_timeout_add_seconds( 3, testing_port_begin, data );
    13141314    }
    13151315}
    13161316