No longer try to automatically backup binary files (especially nasty when loading subs from mkv).

Originally committed to SVN as r1047.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-09 05:59:46 +00:00
parent be5c36bcab
commit 1c6bea3220
1 changed files with 3 additions and 1 deletions

View File

@ -546,6 +546,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
// Setup
bool isFile = (filename != _T(""));
bool isBinary = false;
// Load
try {
@ -556,6 +557,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
// Make sure that file isn't actually a timecode file
TextFileReader testSubs(filename);
isBinary = testSubs.GetCurrentEncoding() == _T("binary");
if (testSubs.HasMoreLines()) {
wxString cur = testSubs.ReadLineFromFile();
if (cur.Left(10) == _T("# timecode")) {
@ -587,7 +589,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
// Save copy
wxFileName origfile(filename);
if (Options.AsBool(_T("Auto backup")) && origfile.FileExists()) {
if (!isBinary && Options.AsBool(_T("Auto backup")) && origfile.FileExists()) {
// Get path
wxString path = Options.AsText(_T("Auto backup path"));
if (path.IsEmpty()) path = origfile.GetPath();