mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
GUI: Make TextViewerDialog use a Path instead of a String
This commit is contained in:
parent
74a6158347
commit
fd0267cfd1
@ -39,7 +39,7 @@ namespace GUI {
|
||||
#define kPadX 0.05
|
||||
#define kPadY 0.05
|
||||
|
||||
TextViewerDialog::TextViewerDialog(Common::String fname)
|
||||
TextViewerDialog::TextViewerDialog(const Common::Path &fname)
|
||||
: Dialog(0, 0, 1, 1), _fname(fname) {
|
||||
_font = &g_gui.getFont(ThemeEngine::kFontStyleConsole);
|
||||
_charWidth = _font->getMaxCharWidth();
|
||||
@ -64,11 +64,11 @@ TextViewerDialog::~TextViewerDialog() {
|
||||
destroy();
|
||||
}
|
||||
|
||||
bool TextViewerDialog::loadFile(Common::String &fname) {
|
||||
bool TextViewerDialog::loadFile(const Common::Path &fname) {
|
||||
Common::FSNode file(fname);
|
||||
|
||||
if (!file.exists()) {
|
||||
warning("TextViewerDialog::loadFile(): Cannot open file %s", fname.c_str());
|
||||
warning("TextViewerDialog::loadFile(): Cannot open file %s", fname.toString(Common::Path::kNativeSeparator).c_str());
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -76,7 +76,7 @@ bool TextViewerDialog::loadFile(Common::String &fname) {
|
||||
Common::SeekableReadStream *stream = file.createReadStream();
|
||||
|
||||
if (!stream) {
|
||||
warning("TextViewerDialog::loadFile(): Cannot load file %s", fname.c_str());
|
||||
warning("TextViewerDialog::loadFile(): Cannot load file %s", fname.toString(Common::Path::kNativeSeparator).c_str());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -51,14 +51,14 @@ private:
|
||||
ScrollBarWidget *_scrollBar;
|
||||
ButtonWidget *_closeButton;
|
||||
|
||||
Common::String _fname;
|
||||
Common::Path _fname;
|
||||
const Graphics::Font *_font = nullptr;
|
||||
|
||||
bool loadFile(Common::String &fname);
|
||||
bool loadFile(const Common::Path &fname);
|
||||
void reflowLayout();
|
||||
|
||||
public:
|
||||
TextViewerDialog(Common::String fname);
|
||||
TextViewerDialog(const Common::Path &fname);
|
||||
~TextViewerDialog();
|
||||
|
||||
void destroy();
|
||||
|
Loading…
x
Reference in New Issue
Block a user