Changeset 7693


Ignore:
Timestamp:
Jan 13, 2009, 1:44:59 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #1690: Torrent is completed without ever starting (because there's nothing to download)

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-torrent.c

    r7473 r7693  
    163163
    164164static void
    165 completenessChangedCallback( tr_torrent       * tor UNUSED,
     165completenessChangedCallback( tr_torrent       * tor,
    166166                             tr_completeness    completeness,
    167167                             void *             user_data )
    168168{
    169     if( completeness != TR_LEECH )
     169    if( ( completeness != TR_LEECH ) && ( tr_torrentStat( tor )->sizeWhenDone != 0 ) )
    170170        g_idle_add( notifyInMainThread, user_data );
    171171}
  • trunk/gtk/util.c

    r7473 r7693  
    2424
    2525#include <ctype.h> /* isxdigit() */
     26#include <errno.h>
    2627#include <stdarg.h>
    2728#include <stdlib.h> /* free() */
     
    522523        gboolean trashed = FALSE;
    523524#ifdef HAVE_GIO
     525        GError * err = NULL;
    524526        GFile *  file = g_file_new_for_path( filename );
    525         trashed = g_file_trash( file, NULL, NULL );
     527        trashed = g_file_trash( file, NULL, &err );
     528        if( err )
     529            g_message( "Unable to trash file \"%s\": %s", filename, err->message );
     530        g_clear_error( &err );
    526531        g_object_unref( G_OBJECT( file ) );
    527 #endif
    528         if( !trashed )
    529             g_unlink( filename );
     532       
     533       
     534#endif
     535        if( !trashed ) {
     536            if( g_unlink( filename ) ) {
     537                const int err = errno;
     538                g_message( "Unable to unlink file \"%s\": %s", filename, g_strerror( err ) );
     539            }
     540        }
    530541    }
    531542
Note: See TracChangeset for help on using the changeset viewer.