diff options
-rw-r--r-- | gui/dialog.cpp | 4 | ||||
-rw-r--r-- | util.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 88c9cecc51..c4f53892c7 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -304,7 +304,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat { switch (cmd) { case kSaveCmd: - if (_savegameList->getSelectedString()[0] != 0) { + if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) { Scumm *s = _gui->getScumm(); s->_saveLoadSlot = _savegameList->getSelected(); s->_saveLoadCompatible = false; @@ -314,7 +314,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat } break; case kLoadCmd: - if (_savegameList->getSelectedString()[0] != 0) { + if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) { Scumm *s = _gui->getScumm(); s->_saveLoadSlot = _savegameList->getSelected(); s->_saveLoadCompatible = false; @@ -103,6 +103,8 @@ public: _size = 0; _capacity = 0; } + + bool isEmpty() const { return (_size == 0); } protected: void ensureCapacity(int new_len) @@ -150,6 +152,8 @@ public: void deleteLastChar(); void clear(); + bool isEmpty() const { return (_len == 0); } + protected: void ensureCapacity(int new_len, bool keep_old); void decRefCount(); |