Changeset 12680
- Timestamp:
- Aug 13, 2011, 10:24:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/tr-core.c
r12678 r12680 563 563 } 564 564 565 static void 566 rename_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 565 578 static gboolean 566 579 core_watchdir_idle( gpointer gcore ) … … 592 605 core->priv->adding_from_watch_dir = TRUE; 593 606 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 ); 595 608 g_slist_free( unchanging ); 596 609 core->priv->adding_from_watch_dir = FALSE;
Note: See TracChangeset
for help on using the changeset viewer.