diff options
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/Main.cs | 20 | ||||
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 8 |
2 files changed, 24 insertions, 4 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 95a17cfb3..04d4d16b4 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -350,5 +350,25 @@ namespace Handbrake.Functions return -1;
}
+ /// <summary>
+ /// Clear all the encode log files.
+ /// </summary>
+ public static void clearLogs()
+ {
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ if (Directory.Exists(logDir))
+ {
+ DirectoryInfo info = new DirectoryInfo(logDir);
+ FileInfo[] logFiles = info.GetFiles("*.txt");
+ foreach (FileInfo file in logFiles)
+ {
+ if (!file.Name.Contains("last_scan_log") && !file.Name.Contains("last_encode_log") && !file.Name.Contains("tmp_appReadable_log.txt"))
+ {
+ File.Delete(file.FullName);
+ }
+ }
+ }
+ }
+
}
}
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs index 373041107..0394df6cf 100644 --- a/win/C#/Functions/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -24,8 +24,8 @@ namespace Handbrake.Functions // Source tab
string query = "";
- if ((mainWindow.text_source.Text != "") && (mainWindow.text_source.Text.Trim() != "Click 'Source' to continue"))
- query = " -i " + '"' + mainWindow.text_source.Text + '"';
+ if ((mainWindow.sourcePath != "") && (mainWindow.sourcePath.Trim() != "Click 'Source' to continue"))
+ query = " -i " + '"' + mainWindow.sourcePath + '"';
if (mainWindow.drp_dvdtitle.Text != "Automatic")
{
@@ -68,8 +68,8 @@ namespace Handbrake.Functions // Source tab
string query = "";
- if ((mainWindow.text_source.Text != "") && (mainWindow.text_source.Text.Trim() != "Click 'Source' to continue"))
- query = " -i " + '"' + mainWindow.text_source.Text + '"';
+ if ((mainWindow.sourcePath != "") && (mainWindow.sourcePath.Trim() != "Click 'Source' to continue"))
+ query = " -i " + '"' + mainWindow.sourcePath + '"';
if (mainWindow.drp_dvdtitle.Text != "Automatic")
{
|