]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix for "{source_path}" option.
authorsr55 <sr55.hb@outlook.com>
Thu, 24 Mar 2011 21:40:17 +0000 (21:40 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 24 Mar 2011 21:40:17 +0000 (21:40 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3877 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Functions/Main.cs

index ae53efe903585940e14b6e680f603e9624f83697..33491ed963ed9af6428e508ca7d98e91d05947fe 100644 (file)
@@ -244,20 +244,20 @@ namespace Handbrake.Functions
                     destinationFilename += ".mkv";\r
 \r
                 // Now work out the path where the file will be stored.\r
-                // First case: If the destination box doesn't already contain a path, make one.\r
-                if (!mainWindow.text_destination.Text.Contains(Path.DirectorySeparatorChar.ToString()))\r
+                // If there is an auto name path, use it...\r
+                if (Properties.Settings.Default.autoNamePath.Trim() == "{source_path}" && !string.IsNullOrEmpty(mainWindow.sourcePath))\r
                 {\r
-                    // If there is an auto name path, use it...\r
-                    if (Properties.Settings.Default.autoNamePath.Trim() == "{source_path}" && !string.IsNullOrEmpty(mainWindow.sourcePath))\r
+                    autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), destinationFilename);\r
+                    if (autoNamePath == mainWindow.sourcePath)\r
                     {\r
-                        autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), destinationFilename);\r
-                        if (autoNamePath == mainWindow.sourcePath)\r
-                        {\r
-                            // Append out_ to files that already exist or is the source file\r
-                            autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), "output_" + destinationFilename);\r
-                        }\r
+                        // Append out_ to files that already exist or is the source file\r
+                        autoNamePath = Path.Combine(Path.GetDirectoryName(mainWindow.sourcePath), "output_" + destinationFilename);\r
                     }\r
-                    else if (Properties.Settings.Default.autoNamePath.Trim() != string.Empty && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")\r
+                }\r
+                // Second case: If the destination box doesn't already contain a path, make one.\r
+                else if (!mainWindow.text_destination.Text.Contains(Path.DirectorySeparatorChar.ToString()))\r
+                {\r
+                    if (Properties.Settings.Default.autoNamePath.Trim() != string.Empty && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")\r
                     {\r
                         autoNamePath = Path.Combine(Properties.Settings.Default.autoNamePath, destinationFilename);\r
                     }\r