Changeset 12680


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

(trunk gtk) sync the gtk+ client's watchdir behavior with the daemon's wrt r12668

File:
1 edited

Legend:

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

    r12678 r12680  
    563563}
    564564
     565static void
     566rename_torrent_and_unref_file( GFile * file )
     567{
     568    GFileInfo * info = g_file_query_info( file, G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME, 0, NULL, NULL );
     569    const char * old_name = g_file_info_get_attribute_string( info, G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME );
     570    char * new_name = g_strdup_printf( "%s.added", old_name );
     571    GFile * new_file = g_file_set_display_name( file, new_name, NULL, NULL );
     572    g_object_unref( G_OBJECT( new_file ) );
     573    g_free( new_name );
     574    g_object_unref( G_OBJECT( info ) );
     575    g_object_unref( G_OBJECT( file ) );
     576}
     577
    565578static gboolean
    566579core_watchdir_idle( gpointer gcore )
     
    592605        core->priv->adding_from_watch_dir = TRUE;
    593606        gtr_core_add_files( core, unchanging, do_start, do_prompt, TRUE );
    594         g_slist_foreach( unchanging, (GFunc)g_object_unref, NULL );
     607        g_slist_foreach( unchanging, (GFunc)rename_torrent_and_unref_file, NULL );
    595608        g_slist_free( unchanging );
    596609        core->priv->adding_from_watch_dir = FALSE;
Note: See TracChangeset for help on using the changeset viewer.