OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 31 Dec 2010 17:08:18 +0000 (17:08 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 31 Dec 2010 17:08:18 +0000 (17:08 +0000)
- Quick fix for the folder source selection when selecting a drive letter. It appears escape chars were getting sent to the CLI when they shouldn't have been. I'll tidy this up later.

git-svn-id: svn://localhost/HandBrake/trunk@3721 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/HandBrake.ApplicationServices/Services/Scan.cs

index e2412cb..2a5188a 100644 (file)
@@ -184,14 +184,22 @@ namespace HandBrake.ApplicationServices.Services
                 if (title > 0)\r
                     extraArguments += " --scan ";\r
 \r
+                // Quick fix for "F:\\" style paths. Just get rid of the \\ so the CLI doesn't fall over.\r
+                // Sould probably clean up the escaping of the strings later.\r
+                if (sourcePath.ToString().EndsWith("\\"))\r
+                {\r
+                    sourcePath = sourcePath.ToString().Replace("\\", string.Empty);\r
+                }\r
+\r
+                string source = "\"" + sourcePath + "\"";\r
+                string command = String.Format(@" -i {0} -t{1} {2} -v ", source, title, extraArguments);\r
+\r
                 this.hbProc = new Process\r
                                   {\r
                                       StartInfo =\r
                                           {\r
                                               FileName = handbrakeCLIPath,\r
-                                              Arguments =\r
-                                                  String.Format(@" -i ""{0}"" -t{1} {2} -v ", sourcePath, title,\r
-                                                                extraArguments),\r
+                                              Arguments = command,\r
                                               RedirectStandardOutput = true,\r
                                               RedirectStandardError = true,\r
                                               UseShellExecute = false,\r
@@ -213,7 +221,10 @@ namespace HandBrake.ApplicationServices.Services
                     if (this.readData.Buffer.Length < 100000000)\r
                     {\r
                         scanLog.WriteLine(Logging.CreateCliLogHeader(null));\r
+                        scanLog.WriteLine("Query: " + command);\r
                         scanLog.Write(this.readData.Buffer);\r
+\r
+                        logBuffer.AppendLine("Query: " + command);\r
                         logBuffer.AppendLine(this.readData.Buffer.ToString());\r
                     }\r
                     else\r