]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #2363 "daemon on mac moves config files on first launch" -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Sun, 30 Jan 2011 01:33:53 +0000 (01:33 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 30 Jan 2011 01:33:53 +0000 (01:33 +0000)
Don't run platform.c's migrateFiles() except on *nix platforms. Add comment explaining when the function is used and why.

libtransmission/platform.c

index 820d8c4086a9a22d42866c3ece3bd45b242bcf54..119d22f8043808ccede74722ae7100886afeaac9 100644 (file)
@@ -369,12 +369,18 @@ moveFiles( const char * oldDir,
     }
 }
 
+/**
+ * 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 )
+    if( !migrated && should_migrate )
     {
         const char * oldDir;
         const char * newDir;