mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Fixed memory leak in statistics + missing translation
This commit is contained in:
parent
0e188fd912
commit
bf2d51819b
@ -10,9 +10,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
public sealed partial class Statistics : PositionAndSizeForm
|
public sealed partial class Statistics : PositionAndSizeForm
|
||||||
{
|
{
|
||||||
private Subtitle _subtitle;
|
private readonly Subtitle _subtitle;
|
||||||
private SubtitleFormat _format;
|
private readonly SubtitleFormat _format;
|
||||||
private LanguageStructure.Statistics _l;
|
private readonly LanguageStructure.Statistics _l;
|
||||||
private string _mostUsedLines;
|
private string _mostUsedLines;
|
||||||
private string _general;
|
private string _general;
|
||||||
private string _mostUsedWords;
|
private string _mostUsedWords;
|
||||||
@ -36,10 +36,7 @@ https://github.com/SubtitleEdit/subtitleedit
|
|||||||
_format = format;
|
_format = format;
|
||||||
|
|
||||||
_l = Configuration.Settings.Language.Statistics;
|
_l = Configuration.Settings.Language.Statistics;
|
||||||
if (string.IsNullOrEmpty(fileName))
|
Text = string.IsNullOrEmpty(fileName) ? _l.Title : string.Format(_l.TitleWithFileName, fileName);
|
||||||
Text = _l.Title;
|
|
||||||
else
|
|
||||||
Text = string.Format(_l.TitleWithFileName, fileName);
|
|
||||||
groupBoxGeneral.Text = _l.GeneralStatistics;
|
groupBoxGeneral.Text = _l.GeneralStatistics;
|
||||||
groupBoxMostUsed.Text = _l.MostUsed;
|
groupBoxMostUsed.Text = _l.MostUsed;
|
||||||
labelMostUsedWords.Text = _l.MostUsedWords;
|
labelMostUsedWords.Text = _l.MostUsedWords;
|
||||||
@ -172,7 +169,7 @@ https://github.com/SubtitleEdit/subtitleedit
|
|||||||
var endIdx = text.IndexOf('>', idx + 5);
|
var endIdx = text.IndexOf('>', idx + 5);
|
||||||
if (endIdx < idx)
|
if (endIdx < idx)
|
||||||
{
|
{
|
||||||
error = !error;
|
error = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
endIdx++;
|
endIdx++;
|
||||||
@ -316,12 +313,14 @@ https://github.com/SubtitleEdit/subtitleedit
|
|||||||
|
|
||||||
private void buttonExport_Click(object sender, EventArgs e)
|
private void buttonExport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var saveFile = new SaveFileDialog { Filter = "Text files (*.txt)|*.txt|NFO files (*.nfo)|*.nfo" };
|
using (var saveFile = new SaveFileDialog { Filter = Configuration.Settings.Language.Main.TextFiles + " (*.txt)|*.txt|NFO files (*.nfo)|*.nfo" })
|
||||||
if (saveFile.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
{
|
||||||
string fileName = saveFile.FileName;
|
if (saveFile.ShowDialog() == DialogResult.OK)
|
||||||
var statistic = string.Format(WriteFormat, _general, _mostUsedWords, _mostUsedLines);
|
{
|
||||||
System.IO.File.WriteAllText(fileName, statistic);
|
string fileName = saveFile.FileName;
|
||||||
|
var statistic = string.Format(WriteFormat, _general, _mostUsedWords, _mostUsedLines);
|
||||||
|
System.IO.File.WriteAllText(fileName, statistic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user