static void migrateFiles( const tr_handle * handle ) { static int migrated = FALSE; if( !migrated ) { const char * oldDir; const char * newDir; migrated = TRUE; oldDir = getOldTorrentsDir( ); newDir = tr_getTorrentDir( handle ); moveFiles( oldDir, newDir ); oldDir = getOldCacheDir( ); newDir = tr_getResumeDir( handle ); moveFiles( oldDir, newDir ); } }
/** * This function is for transmission-gtk users to migrate the config files * from $HOME/.transmission/ (where they were kept before Transmission 1.30) * to $HOME/.config/$appname as per the XDG directory spec. */ static void migrateFiles( const tr_session * session ) { static int migrated = FALSE; const tr_bool should_migrate = strstr( getOldConfigDir(), ".transmission" ) != NULL; if( !migrated && should_migrate ) { const char * oldDir; const char * newDir; migrated = TRUE; oldDir = getOldTorrentsDir( ); newDir = tr_getTorrentDir( session ); moveFiles( oldDir, newDir ); oldDir = getOldCacheDir( ); newDir = tr_getResumeDir( session ); moveFiles( oldDir, newDir ); } }