Don't display an error message if user cancels the charset selection dialog

This commit is contained in:
Thomas Goyne 2013-02-04 19:26:54 -08:00
parent 3d48f18542
commit 8118d790a4

View file

@ -86,8 +86,13 @@ void SubsController::Load(agi::fs::path const& filename, std::string charset) {
// TextFileReader does this automatically, but relying on that results in
// the user being prompted twice if it can't be auto-detected, since we
// open the file twice below.
try {
if (charset.empty())
charset = CharSetDetect::GetEncoding(filename);
}
catch (agi::UserCancelException const&) {
return;
}
// Make sure that file isn't actually a timecode file
if (charset != "binary") {