aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/wince/CELauncherDialog.cpp2
-rw-r--r--base/gameDetector.cpp6
-rw-r--r--base/main.cpp8
-rw-r--r--common/array.h2
-rw-r--r--common/assocarray.h11
-rw-r--r--common/config-file.cpp10
-rw-r--r--common/config-manager.cpp38
-rw-r--r--common/list.h2
-rw-r--r--common/map.h2
-rw-r--r--common/stack.h2
-rw-r--r--common/str.h2
-rw-r--r--common/util.cpp6
-rw-r--r--engines/gob/gob.cpp2
-rw-r--r--engines/kyra/kyra.cpp2
-rw-r--r--engines/lure/lure.cpp2
-rw-r--r--engines/lure/res_struct.cpp2
-rw-r--r--engines/lure/room.cpp2
-rw-r--r--engines/queen/display.cpp2
-rw-r--r--engines/saga/game.cpp2
-rw-r--r--engines/saga/sthread.cpp2
-rw-r--r--engines/scumm/dialogs.cpp12
-rw-r--r--engines/scumm/resource.cpp2
-rw-r--r--engines/simon/game.cpp2
-rw-r--r--gui/PopUpWidget.cpp2
-rw-r--r--gui/launcher.cpp28
-rw-r--r--gui/options.cpp10
-rw-r--r--sound/mididrv.cpp2
-rw-r--r--test/common/array.h8
-rw-r--r--test/common/list.h8
-rw-r--r--test/common/map.h8
-rw-r--r--test/common/str.h6
31 files changed, 101 insertions, 94 deletions
diff --git a/backends/wince/CELauncherDialog.cpp b/backends/wince/CELauncherDialog.cpp
index ea5a366955..90675fb3da 100644
--- a/backends/wince/CELauncherDialog.cpp
+++ b/backends/wince/CELauncherDialog.cpp
@@ -87,7 +87,7 @@ void CELauncherDialog::addCandidate(String &path, DetectedGameList &candidates)
int idx = -1;
DetectedGame result;
- if (candidates.isEmpty())
+ if (candidates.empty())
return;
if (candidates.size() == 1)
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 6e89c95f73..63cb075401 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -257,7 +257,7 @@ void listTargets() {
String name(iter->_key);
String description(iter->_value.get("description"));
- if (description.isEmpty()) {
+ if (description.empty()) {
// FIXME: At this point, we should check for a "gameid" override
// to find the proper desc. In fact, the platform probably should
// be taken into account, too.
@@ -634,7 +634,7 @@ void GameDetector::setTarget(const String &target) {
}
bool GameDetector::detectMain() {
- if (_targetName.isEmpty()) {
+ if (_targetName.empty()) {
warning("No game was specified...");
return false;
}
@@ -656,7 +656,7 @@ bool GameDetector::detectMain() {
printf("Trying to start game '%s'\n", game.description.c_str());
String gameDataPath(ConfMan.get("path"));
- if (gameDataPath.isEmpty()) {
+ if (gameDataPath.empty()) {
warning("No path was provided. Assuming the data files are in the current directory");
gameDataPath = "./";
} else if (gameDataPath.lastChar() != '/'
diff --git a/base/main.cpp b/base/main.cpp
index 6eacd122f8..56a820f438 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -297,11 +297,11 @@ static int runGame(GameDetector &detector, OSystem &system, const Common::String
Common::String caption(ConfMan.get("description", detector._targetName));
Common::String desc = GameDetector::findGame(detector._gameid).description;
- if (caption.isEmpty() && !desc.isEmpty())
+ if (caption.empty() && !desc.empty())
caption = desc;
- if (caption.isEmpty())
+ if (caption.empty())
caption = detector._targetName;
- if (!caption.isEmpty()) {
+ if (!caption.empty()) {
system.setWindowCaption(caption.c_str());
}
@@ -494,7 +494,7 @@ extern "C" int main(int argc, char *argv[]) {
system.setWindowCaption(gScummVMFullVersion);
// Unless a game was specified, show the launcher dialog
- if (detector._targetName.isEmpty())
+ if (detector._targetName.empty())
running = launcherDialog(detector, system);
else
// Setup a dummy palette, for the mouse cursor, in case an error
diff --git a/common/array.h b/common/array.h
index ec4ea818d0..6493a9bda7 100644
--- a/common/array.h
+++ b/common/array.h
@@ -130,7 +130,7 @@ public:
_capacity = 0;
}
- bool isEmpty() const {
+ bool empty() const {
return (_size == 0);
}
diff --git a/common/assocarray.h b/common/assocarray.h
index 0e10ea7f4f..8505f48c19 100644
--- a/common/assocarray.h
+++ b/common/assocarray.h
@@ -140,9 +140,16 @@ public:
// even allow in-place modifications of
Key *new_all_keys(void) const;
Val *new_all_values(void) const;
+ //const_iterator begin() const
+ //const_iterator end() const
-
- // TODO: There is no "remove(key)" method yet.
+ // TODO: There is no "remove" method yet.
+ //void remove(const Key &key);
+
+
+ bool empty() const {
+ return (_nele == 0);
+ }
};
//-------------------------------------------------------
diff --git a/common/config-file.cpp b/common/config-file.cpp
index cb770f625e..568b5f554f 100644
--- a/common/config-file.cpp
+++ b/common/config-file.cpp
@@ -122,7 +122,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
*p = 0;
// Previous section is finished now, store it.
- if (!section.name.isEmpty())
+ if (!section.name.empty())
_sections.push_back(section);
section.name = buf + 1;
@@ -140,7 +140,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
continue;
// If no section has been set, this config file is invalid!
- if (section.name.isEmpty()) {
+ if (section.name.empty()) {
error("Config file buggy: Key/value pair found outside a section in line %d", lineno);
}
@@ -162,7 +162,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
}
// Save last section
- if (!section.name.isEmpty())
+ if (!section.name.empty())
_sections.push_back(section);
return (!stream.ioFailed() || stream.eos());
@@ -179,7 +179,7 @@ bool ConfigFile::saveToFile(const String &filename) {
bool ConfigFile::saveToStream(WriteStream &stream) {
for (List<Section>::iterator i = _sections.begin(); i != _sections.end(); ++i) {
// Write out the section comment, if any
- if (! i->comment.isEmpty()) {
+ if (! i->comment.empty()) {
stream.writeString(i->comment);
}
@@ -192,7 +192,7 @@ bool ConfigFile::saveToStream(WriteStream &stream) {
// Write out the key/value pairs
for (List<KeyValue>::iterator kv = i->keys.begin(); kv != i->keys.end(); ++kv) {
// Write out the comment, if any
- if (! kv->comment.isEmpty()) {
+ if (! kv->comment.empty()) {
stream.writeString(kv->comment);
}
// Write out the key/value pair
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index ee49a4babf..17f7d3bd62 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -198,7 +198,7 @@ void ConfigManager::loadFile(const String &filename) {
continue;
// If no domain has been set, this config file is invalid!
- if (domain.isEmpty()) {
+ if (domain.empty()) {
error("Config file buggy: Key/value pair found outside a domain in line %d", lineno);
}
@@ -265,14 +265,14 @@ void ConfigManager::flushToDisk() {
}
void ConfigManager::writeDomain(FILE *file, const String &name, const Domain &domain) {
- if (domain.isEmpty())
+ if (domain.empty())
return; // Don't bother writing empty domains.
String comment;
// Write domain comment (if any)
comment = domain.getDomainComment();
- if (!comment.isEmpty())
+ if (!comment.empty())
fprintf(file, "%s", comment.c_str());
// Write domain start
@@ -282,7 +282,7 @@ void ConfigManager::writeDomain(FILE *file, const String &name, const Domain &do
Domain::const_iterator x;
for (x = domain.begin(); x != domain.end(); ++x) {
const String &value = x->_value;
- if (!value.isEmpty()) {
+ if (!value.empty()) {
// Write comment (if any)
if (domain.hasKVComment(x->_key)) {
comment = domain.getKVComment(x->_key);
@@ -308,7 +308,7 @@ bool ConfigManager::hasKey(const String &key) const {
if (_transientDomain.contains(key))
return true;
- if (!_activeDomain.isEmpty() && _gameDomains[_activeDomain].contains(key))
+ if (!_activeDomain.empty() && _gameDomains[_activeDomain].contains(key))
return true;
DomainMap::const_iterator iter;
@@ -321,7 +321,7 @@ bool ConfigManager::hasKey(const String &key) const {
}
bool ConfigManager::hasKey(const String &key, const String &dom) const {
- assert(!dom.isEmpty());
+ assert(!dom.empty());
assert(isValidDomainName(dom));
if (dom == kTransientDomain)
@@ -335,7 +335,7 @@ bool ConfigManager::hasKey(const String &key, const String &dom) const {
}
void ConfigManager::removeKey(const String &key, const String &dom) {
- assert(!dom.isEmpty());
+ assert(!dom.empty());
assert(isValidDomainName(dom));
if (dom == kTransientDomain)
@@ -361,12 +361,12 @@ const String & ConfigManager::get(const String &key, const String &domain) const
// 3) All global domains
// 4) The defaults
- if ((domain.isEmpty() || domain == kTransientDomain) && _transientDomain.contains(key))
+ if ((domain.empty() || domain == kTransientDomain) && _transientDomain.contains(key))
return _transientDomain[key];
- const String &dom = domain.isEmpty() ? _activeDomain : domain;
+ const String &dom = domain.empty() ? _activeDomain : domain;
- if (!dom.isEmpty() && _gameDomains.contains(dom) && _gameDomains[dom].contains(key))
+ if (!dom.empty() && _gameDomains.contains(dom) && _gameDomains[dom].contains(key))
return _gameDomains[dom][key];
DomainMap::const_iterator iter;
@@ -385,7 +385,7 @@ int ConfigManager::getInt(const String &key, const String &dom) const {
// For now, be tolerant against missing config keys. Strictly spoken, it is
// a bug in the calling code to retrieve an int for a key which isn't even
// present... and a default value of 0 seems rather arbitrary.
- if (value.isEmpty())
+ if (value.empty())
return 0;
int ivalue = (int)strtol(value.c_str(), &errpos, 10);
@@ -412,11 +412,11 @@ bool ConfigManager::getBool(const String &key, const String &dom) const {
void ConfigManager::set(const String &key, const String &value, const String &dom) {
assert(isValidDomainName(dom));
- if (dom.isEmpty()) {
+ if (dom.empty()) {
// Remove the transient domain value
_transientDomain.remove(key);
- if (_activeDomain.isEmpty())
+ if (_activeDomain.empty())
_globalDomains[kApplicationDomain][key] = value;
else
_gameDomains[_activeDomain][key] = value;
@@ -428,7 +428,7 @@ void ConfigManager::set(const String &key, const String &value, const String &do
else {
if (_globalDomains.contains(dom)) {
_globalDomains[dom][key] = value;
- if (_activeDomain.isEmpty() || !_gameDomains[_activeDomain].contains(key))
+ if (_activeDomain.empty() || !_gameDomains[_activeDomain].contains(key))
_transientDomain.remove(key);
} else {
_gameDomains[dom][key] = value;
@@ -480,14 +480,14 @@ void ConfigManager::registerDefault(const String &key, bool value) {
void ConfigManager::setActiveDomain(const String &domain) {
- assert(!domain.isEmpty());
+ assert(!domain.empty());
assert(isValidDomainName(domain));
_activeDomain = domain;
_gameDomains.addKey(domain);
}
void ConfigManager::removeGameDomain(const String &domain) {
- assert(!domain.isEmpty());
+ assert(!domain.empty());
assert(isValidDomainName(domain));
_gameDomains.remove(domain);
}
@@ -496,8 +496,8 @@ void ConfigManager::renameGameDomain(const String &oldName, const String &newNam
if (oldName == newName)
return;
- assert(!oldName.isEmpty());
- assert(!newName.isEmpty());
+ assert(!oldName.empty());
+ assert(!newName.empty());
assert(isValidDomainName(oldName));
assert(isValidDomainName(newName));
@@ -507,7 +507,7 @@ void ConfigManager::renameGameDomain(const String &oldName, const String &newNam
}
bool ConfigManager::hasGameDomain(const String &domain) const {
- assert(!domain.isEmpty());
+ assert(!domain.empty());
return isValidDomainName(domain) && _gameDomains.contains(domain);
}
diff --git a/common/list.h b/common/list.h
index 6d93636798..eac6b917f9 100644
--- a/common/list.h
+++ b/common/list.h
@@ -230,7 +230,7 @@ public:
erase(begin(), end());
}
- bool isEmpty() const {
+ bool empty() const {
return (_anchor == _anchor->_next);
}
diff --git a/common/map.h b/common/map.h
index 091e646eef..25cb94fb9a 100644
--- a/common/map.h
+++ b/common/map.h
@@ -150,7 +150,7 @@ public:
_root = 0;
}
- bool isEmpty() const {
+ bool empty() const {
return (_root == 0);
}
diff --git a/common/stack.h b/common/stack.h
index 5e4e55035b..ce438b6174 100644
--- a/common/stack.h
+++ b/common/stack.h
@@ -83,7 +83,7 @@ public:
Stack<T>() {}
bool empty() const {
- return _stack.isEmpty();
+ return _stack.empty();
}
void clear() {
_stack.clear();
diff --git a/common/str.h b/common/str.h
index 48fc2864d3..b345000164 100644
--- a/common/str.h
+++ b/common/str.h
@@ -71,7 +71,7 @@ public:
const char *c_str() const { return _str ? _str : ""; }
uint size() const { return _len; }
- bool isEmpty() const { return (_len == 0); }
+ bool empty() const { return (_len == 0); }
char lastChar() const { return (_len > 0) ? _str[_len-1] : 0; }
char operator [](int idx) const {
diff --git a/common/util.cpp b/common/util.cpp
index fc01565582..e032601857 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -131,7 +131,7 @@ const LanguageDescription g_languages[] = {
};
Language parseLanguage(const String &str) {
- if (str.isEmpty())
+ if (str.empty())
return UNK_LANG;
const char *s = str.c_str();
@@ -189,7 +189,7 @@ const PlatformDescription g_platforms[] = {
};
Platform parsePlatform(const String &str) {
- if (str.isEmpty())
+ if (str.empty())
return kPlatformUnknown;
const char *s = str.c_str();
@@ -245,7 +245,7 @@ const RenderModeDescription g_renderModes[] = {
};
RenderMode parseRenderMode(const String &str) {
- if (str.isEmpty())
+ if (str.empty())
return kRenderDefault;
const char *s = str.c_str();
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 2dbee4cd1f..67b54dc693 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -325,7 +325,7 @@ DetectedGameList Engine_GOB_detectGames(const FSList &fslist) {
detectedGames.push_back(DetectedGame(g->gameid, g->description));
}
}
- if (detectedGames.isEmpty()) {
+ if (detectedGames.empty()) {
printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
const PlainGameDescriptor *g1 = gob_list;
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 051260f77c..ac534c010f 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -188,7 +188,7 @@ DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
detectedGames.push_back(dg);
}
}
- if (detectedGames.isEmpty()) {
+ if (detectedGames.empty()) {
printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
const PlainGameDescriptor *g1 = kyra_list;
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index a034fec156..25a9a1a5c2 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -137,7 +137,7 @@ DetectedGameList Engine_LURE_detectGames(const FSList &fslist) {
detectedGames.push_back(dg);
}
}
- if (detectedGames.isEmpty()) {
+ if (detectedGames.empty()) {
debug("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
const PlainGameDescriptor *g1 = lure_list;
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index a099f51f07..4858f5e06b 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -189,7 +189,7 @@ MovementData::MovementData(MovementResource *rec) {
bool MovementDataList::getFrame(uint16 currentFrame, int16 &xChange,
int16 &yChange, uint16 &nextFrame) {
- if (isEmpty()) return false;
+ if (empty()) return false;
bool foundFlag = false;
iterator i;
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index 6346181cc0..3db3986ef1 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -206,7 +206,7 @@ uint8 Room::checkRoomExits() {
Resources &res = Resources::getReference();
RoomExitHotspotList &exits = _roomData->exitHotspots;
- if (exits.isEmpty()) return CURSOR_ARROW;
+ if (exits.empty()) return CURSOR_ARROW;
RoomExitJoinData *join;
bool skipFlag;
diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp
index dc5c82aa4d..7c9573612a 100644
--- a/engines/queen/display.cpp
+++ b/engines/queen/display.cpp
@@ -836,7 +836,7 @@ void Display::setTextCentered(uint16 y, const char *text, bool outlined) {
void Display::drawTexts() {
for (int y = GAME_SCREEN_HEIGHT - 1; y > 0; --y) {
const TextSlot *pts = &_texts[y];
- if (!pts->text.isEmpty()) {
+ if (!pts->text.empty()) {
drawText(pts->x, y, pts->color, pts->text.c_str(), pts->outlined);
}
}
diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp
index 3ecff99410..b05dea094a 100644
--- a/engines/saga/game.cpp
+++ b/engines/saga/game.cpp
@@ -1599,7 +1599,7 @@ static int detectGame(const FSList *fslist, Common::Language language, Common::P
}
}
- if (!filesMD5.isEmpty() && (matchedCount == 0)) {
+ if (!filesMD5.empty() && (matchedCount == 0)) {
printf("MD5s of your game version are unknown. Please, report following data to\n");
printf("ScummVM team along with your game name and version:\n");
diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp
index 0a1a260cef..a186a61a8b 100644
--- a/engines/saga/sthread.cpp
+++ b/engines/saga/sthread.cpp
@@ -190,7 +190,7 @@ void Script::abortAllThreads(void) {
void Script::completeThread(void) {
int limit = (_vm->getGameType() == GType_IHNM) ? 100 : 40;
- for (int i = 0; i < limit && !_threadList.isEmpty(); i++)
+ for (int i = 0; i < limit && !_threadList.empty(); i++)
executeThreads(0);
}
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index d29b56fa9e..d1d23c2902 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -303,7 +303,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
case GUI::kListItemActivatedCmd:
case GUI::kListItemDoubleClickedCmd:
if (selItem >= 0) {
- if (_saveMode || !getResultString().isEmpty()) {
+ if (_saveMode || !getResultString().empty()) {
setResult(selItem);
close();
}
@@ -316,7 +316,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
// Disable button if nothing is selected, or (in load mode) if an empty
// list item is selected. We allow choosing an empty item in save mode
// because we then just assign a default name.
- _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().isEmpty()));
+ _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().empty()));
_chooseButton->draw();
break;
default:
@@ -434,7 +434,7 @@ void SaveLoadChooserEx::handleCommand(CommandSender *sender, uint32 cmd, uint32
case GUI::kListItemActivatedCmd:
case GUI::kListItemDoubleClickedCmd:
if (selItem >= 0) {
- if (_saveMode || !getResultString().isEmpty()) {
+ if (_saveMode || !getResultString().empty()) {
_list->endEditMode();
setResult(selItem);
close();
@@ -498,7 +498,7 @@ void SaveLoadChooserEx::handleCommand(CommandSender *sender, uint32 cmd, uint32
// Disable button if nothing is selected, or (in load mode) if an empty
// list item is selected. We allow choosing an empty item in save mode
// because we then just assign a default name.
- _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().isEmpty()));
+ _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().empty()));
_chooseButton->draw();
} break;
case kCloseCmd:
@@ -608,10 +608,10 @@ void MainMenuDialog::save() {
_saveDialog->setList(generateSavegameList(_vm, true));
idx = _saveDialog->runModal();
if (idx >= 0) {
- const String &result = _saveDialog->getResultString();
+ String result(_saveDialog->getResultString());
char buffer[20];
const char *str;
- if (result.isEmpty()) {
+ if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
sprintf(buffer, "Save %d", idx + 1);
str = buffer;
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 897459c8be..4dce417216 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -286,7 +286,7 @@ void ScummEngine::readRoomsOffsets() {
bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resourceFile) {
bool result = false;
- if (!_containerFile.isEmpty()) {
+ if (!_containerFile.empty()) {
char name[128];
file.close();
diff --git a/engines/simon/game.cpp b/engines/simon/game.cpp
index da2e0a9e52..907ee978f7 100644
--- a/engines/simon/game.cpp
+++ b/engines/simon/game.cpp
@@ -1450,7 +1450,7 @@ int detectGame(const FSList &fslist, bool mode, int start) {
}
}
- if (!filesMD5.isEmpty() && start == -1) {
+ if (!filesMD5.empty() && start == -1) {
printf("MD5s of your game version are unknown. Please, report following data to\n");
printf("ScummVM team along with your game name and version:\n");
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index f12a4d5637..033b5ddaf6 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -352,7 +352,7 @@ void PopUpWidget::init() {
_selectedItem = -1;
- if (!_label.isEmpty() && _labelWidth == 0)
+ if (!_label.empty() && _labelWidth == 0)
_labelWidth = g_gui.getStringWidth(_label);
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 88ec899adf..0c3cfad17d 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -150,7 +150,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// GAME: Determine the description string
String description(ConfMan.get("description", domain));
- if (description.isEmpty() && !desc.isEmpty()) {
+ if (description.empty() && !desc.empty()) {
description = desc;
}
@@ -202,14 +202,14 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// GUI: Button + Label for the additional path
new ButtonWidget(tab, "gameoptions_extrapath", "Extra Path:", kCmdExtraBrowser, 0);
_extraPathWidget = new StaticTextWidget(tab, "gameoptions_extrapathText", extraPath);
- if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
+ if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPathWidget->setLabel("None");
}
// GUI: Button + Label for the save path
new ButtonWidget(tab, "gameoptions_savepath", "Save Path: ", kCmdSaveBrowser, 0);
_savePathWidget = new StaticTextWidget(tab, "gameoptions_savepathText", savePath);
- if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) {
+ if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
_savePathWidget->setLabel("Default");
}
@@ -318,15 +318,15 @@ void EditGameDialog::close() {
ConfMan.set("language", Common::getLanguageCode(lang), _domain);
String gamePath = _gamePathWidget->getLabel();
- if (!gamePath.isEmpty())
+ if (!gamePath.empty())
ConfMan.set("path", gamePath, _domain);
String extraPath = _extraPathWidget->getLabel();
- if (!extraPath.isEmpty() && (extraPath != "None"))
+ if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
String savePath = _savePathWidget->getLabel();
- if (!savePath.isEmpty() && (savePath != "Default"))
+ if (!savePath.empty() && (savePath != "Default"))
ConfMan.set("savepath", savePath, _domain);
Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag();
@@ -416,7 +416,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// Write back changes made to config object
String newDomain(_domainWidget->getEditString());
if (newDomain != _domain) {
- if (newDomain.isEmpty() || ConfMan.hasGameDomain(newDomain)) {
+ if (newDomain.empty() || ConfMan.hasGameDomain(newDomain)) {
MessageDialog alert("This game ID is already taken. Please choose another one.");
alert.runModal();
return;
@@ -495,7 +495,7 @@ LauncherDialog::LauncherDialog(GameDetector &detector)
}
void LauncherDialog::selectGame(const String &name) {
- if (!name.isEmpty()) {
+ if (!name.empty()) {
int itemToSelect = 0;
StringList::const_iterator iter;
for (iter = _domains.begin(); iter != _domains.end(); ++iter, ++itemToSelect) {
@@ -534,15 +534,15 @@ void LauncherDialog::updateListing() {
String gameid(iter->_value.get("gameid"));
String description(iter->_value.get("description"));
- if (gameid.isEmpty())
+ if (gameid.empty())
gameid = iter->_key;
- if (description.isEmpty()) {
+ if (description.empty()) {
GameDescriptor g = GameDetector::findGame(gameid);
- if (!g.description.isEmpty())
+ if (!g.description.empty())
description = g.description;
}
- if (!gameid.isEmpty() && !description.isEmpty()) {
+ if (!gameid.empty() && !description.empty()) {
// Insert the game into the launcher list
int pos = 0, size = l.size();
@@ -582,7 +582,7 @@ void LauncherDialog::addGame() {
DetectedGameList candidates(PluginManager::instance().detectGames(files));
int idx;
- if (candidates.isEmpty()) {
+ if (candidates.empty()) {
// No game was found in the specified directory
MessageDialog alert("ScummVM could not find any game in the specified directory!");
alert.runModal();
@@ -675,7 +675,7 @@ void LauncherDialog::editGame(int item) {
// music support etc.
assert(item >= 0);
String gameId(ConfMan.get("gameid", _domains[item]));
- if (gameId.isEmpty())
+ if (gameId.empty())
gameId = _domains[item];
EditGameDialog editDialog(_domains[item], GameDetector::findGame(gameId).description);
if (editDialog.runModal() > 0) {
diff --git a/gui/options.cpp b/gui/options.cpp
index 504281e5f7..be99f0c8f6 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -514,7 +514,7 @@ void GlobalOptionsDialog::open() {
Common::String extraPath(ConfMan.get("extrapath", _domain));
Common::String soundFont(ConfMan.get("soundfont", _domain));
- if (!dir.isEmpty()) {
+ if (!dir.empty()) {
_savePath->setLabel(dir);
} else {
// Default to the current directory...
@@ -523,13 +523,13 @@ void GlobalOptionsDialog::open() {
_savePath->setLabel(buf);
}
- if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
+ if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
_extraPath->setLabel("None");
} else {
_extraPath->setLabel(extraPath);
}
- if (soundFont.isEmpty() || !ConfMan.hasKey("soundfont", _domain)) {
+ if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) {
_soundFont->setLabel("None");
} else {
_soundFont->setLabel(soundFont);
@@ -543,11 +543,11 @@ void GlobalOptionsDialog::close() {
ConfMan.set("savepath", _savePath->getLabel(), _domain);
String extraPath = _extraPath->getLabel();
- if (!extraPath.isEmpty() && (extraPath != "None"))
+ if (!extraPath.empty() && (extraPath != "None"))
ConfMan.set("extrapath", extraPath, _domain);
String soundFont = _soundFont->getLabel();
- if (!soundFont.isEmpty() && (soundFont != "None"))
+ if (!soundFont.empty() && (soundFont != "None"))
ConfMan.set("soundfont", soundFont, _domain);
}
OptionsDialog::close();
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 8130ccc0c1..7420a69171 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -112,7 +112,7 @@ const MidiDriverDescription *MidiDriver::getAvailableMidiDrivers() {
}
const MidiDriverDescription &MidiDriver::findMusicDriver(const Common::String &str) {
- if (str.isEmpty())
+ if (str.empty())
return s_musicDrivers[0];
const char *s = str.c_str();
diff --git a/test/common/array.h b/test/common/array.h
index 65f5bff490..f83c3bf0ea 100644
--- a/test/common/array.h
+++ b/test/common/array.h
@@ -6,15 +6,15 @@
class ArrayTestSuite : public CxxTest::TestSuite
{
public:
- void test_isEmpty_clear( void )
+ void test_empty_clear( void )
{
Common::Array<int> array;
- TS_ASSERT( array.isEmpty() );
+ TS_ASSERT( array.empty() );
array.push_back(17);
array.push_back(33);
- TS_ASSERT( !array.isEmpty() );
+ TS_ASSERT( !array.empty() );
array.clear();
- TS_ASSERT( array.isEmpty() );
+ TS_ASSERT( array.empty() );
}
void test_iterator( void )
diff --git a/test/common/list.h b/test/common/list.h
index 3026b204c5..41600f3f29 100644
--- a/test/common/list.h
+++ b/test/common/list.h
@@ -6,15 +6,15 @@
class ListTestSuite : public CxxTest::TestSuite
{
public:
- void test_isEmpty_clear( void )
+ void test_empty_clear( void )
{
Common::List<int> list;
- TS_ASSERT( list.isEmpty() );
+ TS_ASSERT( list.empty() );
list.push_back(17);
list.push_back(33);
- TS_ASSERT( !list.isEmpty() );
+ TS_ASSERT( !list.empty() );
list.clear();
- TS_ASSERT( list.isEmpty() );
+ TS_ASSERT( list.empty() );
}
void test_iterator( void )
diff --git a/test/common/map.h b/test/common/map.h
index c332f0931e..00e5f6c9f6 100644
--- a/test/common/map.h
+++ b/test/common/map.h
@@ -6,15 +6,15 @@
class MapTestSuite : public CxxTest::TestSuite
{
public:
- void test_isEmpty_clear( void )
+ void test_empty_clear( void )
{
Common::Map<int, int> map;
- TS_ASSERT( map.isEmpty() );
+ TS_ASSERT( map.empty() );
map[0] = 17;
map[1] = 33;
- TS_ASSERT( !map.isEmpty() );
+ TS_ASSERT( !map.empty() );
map.clear();
- TS_ASSERT( map.isEmpty() );
+ TS_ASSERT( map.empty() );
}
void test_contains( void )
{
diff --git a/test/common/str.h b/test/common/str.h
index 66d891295e..b3977576b6 100644
--- a/test/common/str.h
+++ b/test/common/str.h
@@ -6,12 +6,12 @@
class StringTestSuite : public CxxTest::TestSuite
{
public:
- void test_isEmpty_clear( void )
+ void test_empty_clear( void )
{
Common::String str("test");
- TS_ASSERT( !str.isEmpty() );
+ TS_ASSERT( !str.empty() );
str.clear();
- TS_ASSERT( str.isEmpty() );
+ TS_ASSERT( str.empty() );
}
void test_lastChar( void )