Changeset 2138


Ignore:
Timestamp:
Jun 17, 2007, 5:04:50 PM (15 years ago)
Author:
charles
Message:
  • when re-queueing an aborted builder, zero out its 'done' and 'aborted' flags
  • gtk+: simplify the "create torrent" cleanup code
Location:
branches/file_selection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/gtk/makemeta-ui.c

    r2132 r2138  
    2020#include "makemeta-ui.h"
    2121#include "util.h"
     22
     23#define UPDATE_INTERVAL_MSEC 200
    2224
    2325typedef struct
     
    8991            gtk_dialog_run( GTK_DIALOG( w ) );
    9092            gtk_widget_destroy( ui->progress_dialog );
    91             ui->builder->abortFlag = 0;
    9293        }
    9394        else
     
    105106
    106107static void
     108remove_tag (gpointer tag)
     109{
     110  g_source_remove (GPOINTER_TO_UINT(tag)); /* stop the periodic refresh */
     111}
     112
     113static void
    107114response_cb( GtkDialog* d, int response, gpointer user_data )
    108115{
     
    111118    char *tmp;
    112119    char buf[1024];
     120    guint tag;
    113121
    114122    if( response != GTK_RESPONSE_ACCEPT )
     
    147155                     gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( ui->private_check ) ) );
    148156
    149     g_timeout_add ( 200, refresh_cb, ui );
     157    tag = g_timeout_add (UPDATE_INTERVAL_MSEC, refresh_cb, ui);
     158    g_object_set_data_full (G_OBJECT(w), "tag", GUINT_TO_POINTER(tag), remove_tag);
    150159}
    151160
  • branches/file_selection/libtransmission/makemeta.c

    r2135 r2138  
    404404    /* cleanup */
    405405    tr_bencFree( & top );
     406    builder->failed |= builder->abortFlag;
    406407    builder->isDone = 1;
    407     builder->failed |= builder->abortFlag;
    408408}
    409409
     
    470470{
    471471    tr_lock_t * lock;
     472
     473    builder->abortFlag = 0;
     474    builder->isDone = 0;
    472475    builder->announce = tr_strdup( announce );
    473476    builder->comment = tr_strdup( comment );
Note: See TracChangeset for help on using the changeset viewer.