summaryrefslogtreecommitdiffstats
path: root/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-07-25 16:20:32 +0000
committersr55 <[email protected]>2010-07-25 16:20:32 +0000
commit324483418fb3049f992999b1dd8881235f35116b (patch)
treea9a0f1b64a0aef08ef9e821619ca53a5f1464d26 /win/C#/HandBrake.ApplicationServices/Services/Scan.cs
parentfe6f44ed88e1d69d7e67738d7c10589a19f60568 (diff)
WinGui:
- Fix some issues with the log window repeating the log header. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3460 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Services/Scan.cs')
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Scan.cs22
1 files changed, 13 insertions, 9 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
index da8d34f7c..558dbb8a7 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs
@@ -94,7 +94,7 @@ namespace HandBrake.ApplicationServices.Services
if (logBuffer == null)
{
- ResetLogReader();
+ ResetLogReader(false);
ReadLastScanFile();
}
@@ -149,12 +149,12 @@ namespace HandBrake.ApplicationServices.Services
if (this.ScanStared != null)
this.ScanStared(this, new EventArgs());
- ResetLogReader();
+ ResetLogReader(true);
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\HandBrake\\logs";
- string dvdInfoPath = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId));
+ string dvdInfoPath = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));
// Make we don't pick up a stale last_encode_log.txt (and that we have rights to the file)
if (File.Exists(dvdInfoPath))
@@ -219,8 +219,8 @@ namespace HandBrake.ApplicationServices.Services
// we'll need to make a copy of it.
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\HandBrake\\logs";
- string logFile = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId));
- string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", Init.InstanceId));
+ string logFile = Path.Combine(logDir, string.Format("last_scan_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));
+ string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));
try
{
@@ -233,7 +233,7 @@ namespace HandBrake.ApplicationServices.Services
File.Copy(logFile, logFile2, true);
else
{
- ResetLogReader();
+ ResetLogReader(true);
return;
}
@@ -257,7 +257,7 @@ namespace HandBrake.ApplicationServices.Services
catch (Exception exc)
{
Console.WriteLine(exc.ToString());
- ResetLogReader();
+ ResetLogReader(true);
}
}
}
@@ -265,11 +265,15 @@ namespace HandBrake.ApplicationServices.Services
/// <summary>
/// Reset the Log Reader
/// </summary>
- private void ResetLogReader()
+ /// <param name="addHeader">
+ /// The add Header.
+ /// </param>
+ private void ResetLogReader(bool addHeader)
{
logFilePosition = 0;
logBuffer = new StringBuilder();
- logBuffer.AppendLine(Logging.CreateCliLogHeader(null));
+ if (addHeader)
+ logBuffer.AppendLine(Logging.CreateCliLogHeader(null));
}
/// <summary>