GUI: Process empty log path and gracefully process unreadable paths
This commit is contained in:
parent
d71accf00d
commit
5751768dc5
2 changed files with 10 additions and 1 deletions
|
@ -2506,7 +2506,10 @@ void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String
|
|||
if (colorOverride)
|
||||
_logPath->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
|
||||
|
||||
new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
|
||||
ButtonWidget *viewButton = new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
|
||||
|
||||
if (logPath.empty())
|
||||
viewButton->setEnabled(false);
|
||||
|
||||
Common::U32String browserPath = _("<default>");
|
||||
if (ConfMan.hasKey("browser_lastpath"))
|
||||
|
|
|
@ -75,6 +75,12 @@ bool TextViewerDialog::loadFile(Common::String &fname) {
|
|||
|
||||
Common::SeekableReadStream *stream = file.createReadStream();
|
||||
|
||||
if (!stream) {
|
||||
warning("TextViewerDialog::loadFile(): Cannot load file %s", fname.c_str());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
warning("TextViewerDialog::loadFile(): File size is: %ld", stream->size());
|
||||
|
||||
_linesArray.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue