Changeset 7774 for trunk/gtk/util.c


Ignore:
Timestamp:
Jan 22, 2009, 8:46:21 PM (13 years ago)
Author:
charles
Message:

(trunk gtk) use g_remove() instead of g_unlink() so that folders can be deleted too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/util.c

    r7693 r7774  
    517517
    518518int
    519 tr_file_trash_or_unlink( const char * filename )
     519tr_file_trash_or_remove( const char * filename )
    520520{
    521521    if( filename && *filename )
     
    530530        g_clear_error( &err );
    531531        g_object_unref( G_OBJECT( file ) );
    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             }
     532#endif
     533
     534        if( !trashed && g_remove( filename ) )
     535        {
     536            const int err = errno;
     537            g_message( "Unable to remove file \"%s\": %s", filename, g_strerror( err ) );
    540538        }
    541539    }
Note: See TracChangeset for help on using the changeset viewer.