diff options
author | sr55 <[email protected]> | 2012-10-13 19:48:12 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-10-13 19:48:12 +0000 |
commit | 029c9b1db2fbf86fc8ded15580cd8023e4b180fc (patch) | |
tree | 227743486b489e989f0b1c67234ebefa4316b10c /win/CS/HandBrake.ApplicationServices/Services | |
parent | 2a18d05b52ea084b4bb968f3622872a8a08d83fa (diff) |
WinGui: Refactor multi-instance support to use Process ID. Fix old log file cleanup function.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5016 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
4 files changed, 5 insertions, 18 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index 8cca6e7e5..8ef67b28d 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -213,7 +213,7 @@ namespace HandBrake.ApplicationServices.Services.Base {
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\HandBrake\\logs";
- string tempLogFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.GetInstanceCount));
+ string tempLogFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.ProcessId));
string encodeDestinationPath = Path.GetDirectoryName(destination);
string destinationFile = Path.GetFileName(destination);
@@ -259,8 +259,8 @@ namespace HandBrake.ApplicationServices.Services.Base {
ShutdownFileWriter();
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.GetInstanceCount));
- string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", GeneralUtilities.GetInstanceCount));
+ string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.ProcessId));
+ string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", GeneralUtilities.ProcessId));
try
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs index c9285ebfe..0a952e516 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IQueueProcessor.cs @@ -154,11 +154,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces void Remove(QueueTask job);
/// <summary>
- /// Temp workaround until this can be fixed properly.
- /// </summary>
- void ResetInstanceId();
-
- /// <summary>
/// Reset a Queued Item from Error or Completed to Waiting
/// </summary>
/// <param name="job">
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 0b3290839..7aefd285f 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -75,7 +75,7 @@ namespace HandBrake.ApplicationServices.Services this.EncodeService = encodeService;
// If this is the first instance, just use the main queue file, otherwise add the instance id to the filename.
- this.queueFile = string.Format("hb_queue_recovery{0}.xml", GeneralUtilities.GetInstanceCount);
+ this.queueFile = string.Format("hb_queue_recovery{0}.xml", GeneralUtilities.ProcessId);
}
#endregion
@@ -331,14 +331,6 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
- /// Temp workaround until this can be fixed properly.
- /// </summary>
- public void ResetInstanceId()
- {
- this.queueFile = string.Format("hb_queue_recovery{0}.xml", GeneralUtilities.GetInstanceCount);
- }
-
- /// <summary>
/// Reset a Queued Item from Error or Completed to Waiting
/// </summary>
/// <param name="job">
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index bb4ec44c6..e7c7a2852 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -246,7 +246,7 @@ namespace HandBrake.ApplicationServices.Services "\\HandBrake\\logs";
string dvdInfoPath = Path.Combine(
logDir,
- string.Format("last_scan_log{0}.txt", GeneralUtilities.GetInstanceCount));
+ string.Format("last_scan_log{0}.txt", GeneralUtilities.ProcessId));
if (!Directory.Exists(logDir))
{
|