[Scummvm-cvs-logs] SF.net SVN: scummvm:[55815] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Feb 7 23:58:22 CET 2011


Revision: 55815
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55815&view=rev
Author:   fingolfin
Date:     2011-02-07 22:58:22 +0000 (Mon, 07 Feb 2011)

Log Message:
-----------
GUI: Rename SaveLoadChooser::runModal to runModalWithPluginAndTarget

This avoids hiding an overloaded virtual method, which in turn can
cause weird bugs (see also the next commit).

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/menu.cpp
    scummvm/trunk/engines/dialogs.cpp
    scummvm/trunk/engines/hugo/file.cpp
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/mohawk/riven.cpp
    scummvm/trunk/engines/parallaction/saveload.cpp
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/toon/toon.cpp
    scummvm/trunk/gui/launcher.cpp
    scummvm/trunk/gui/saveload.cpp
    scummvm/trunk/gui/saveload.h

Modified: scummvm/trunk/engines/cruise/menu.cpp
===================================================================
--- scummvm/trunk/engines/cruise/menu.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/cruise/menu.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -218,7 +218,7 @@
 		dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"));
 
 	dialog->setSaveMode(saveFlag);
-	int slot = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+	int slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 
 	if (slot >= 0) {
 		if (!saveFlag)

Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/dialogs.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -224,7 +224,7 @@
 	const EnginePlugin *plugin = 0;
 	EngineMan.findGame(gameId, &plugin);
 
-	int slot = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
+	int slot = _saveDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 
 	if (slot >= 0) {
 		Common::String result(_saveDialog->getResultString());
@@ -247,7 +247,7 @@
 	const EnginePlugin *plugin = 0;
 	EngineMan.findGame(gameId, &plugin);
 
-	int slot = _loadDialog->runModal(plugin, ConfMan.getActiveDomainName());
+	int slot = _loadDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 
 	if (slot >= 0) {
 		// FIXME: For now we just ignore the return

Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/hugo/file.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -308,7 +308,7 @@
 	if (slot == -1) {
 		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
 		dialog->setSaveMode(true);
-		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 		savegameDescription = dialog->getResultString();
 		delete dialog;
 	} else {
@@ -422,7 +422,7 @@
 	if (slot == -1) {
 		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
 		dialog->setSaveMode(false);
-		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 		delete dialog;
 	} else {
 		savegameId = slot;

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -1114,11 +1114,11 @@
 	_status.viewState = kViewExit;
 }
 
-bool HugoEngine::canLoadGameStateCurrently() const {
+bool HugoEngine::canLoadGameStateCurrently() {
 	return true;
 }
 
-bool HugoEngine::canSaveGameStateCurrently() const {
+bool HugoEngine::canSaveGameStateCurrently() {
 	return (_status.viewState == kViewPlay);
 }
 

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/hugo/hugo.h	2011-02-07 22:58:22 UTC (rev 55815)
@@ -307,8 +307,8 @@
 		return *s_Engine;
 	}
 
-	bool canLoadGameStateCurrently() const;
-	bool canSaveGameStateCurrently() const;
+	virtual bool canLoadGameStateCurrently();
+	virtual bool canSaveGameStateCurrently();
 	bool loadHugoDat();
 
 	char *useBG(const char *name);

Modified: scummvm/trunk/engines/mohawk/riven.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/riven.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/mohawk/riven.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -684,7 +684,7 @@
 	const EnginePlugin *plugin = 0;
 	EngineMan.findGame(gameId, &plugin);
 
-	int slot = slc.runModal(plugin, ConfMan.getActiveDomainName());
+	int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 	if (slot >= 0)
 		loadGameState(slot);
 

Modified: scummvm/trunk/engines/parallaction/saveload.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/saveload.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/parallaction/saveload.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -192,7 +192,7 @@
 	const EnginePlugin *plugin = 0;
 	EngineMan.findGame(gameId, &plugin);
 
-	int idx = slc.runModal(plugin, ConfMan.getActiveDomainName());
+	int idx = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 	if (idx >= 0) {
 		selectedName = slc.getResultString();
 		slc.close();

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -575,7 +575,7 @@
 		EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
 		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"));
 		dialog->setSaveMode(true);
-		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 		game_description = dialog->getResultString();
 		if (game_description.empty()) {
 			// create our own description for the saved game, the user didnt enter it
@@ -675,7 +675,7 @@
 			EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
 			GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"));
 			dialog->setSaveMode(false);
-			savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+			savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 			delete dialog;
 			if (savegameId < 0) {
 				g_sci->_soundCmd->pauseAll(false); // unpause music

Modified: scummvm/trunk/engines/toon/toon.cpp
===================================================================
--- scummvm/trunk/engines/toon/toon.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/engines/toon/toon.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -2976,7 +2976,7 @@
 	if (slot == -1) {
 		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
 		dialog->setSaveMode(true);
-		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 		savegameDescription = dialog->getResultString();
 		delete dialog;
 	} else {
@@ -3074,7 +3074,7 @@
 	if (slot == -1) {
 		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
 		dialog->setSaveMode(false);
-		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
 		delete dialog;
 	} else {
 		savegameId = slot;

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/gui/launcher.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -934,7 +934,7 @@
 	if (plugin) {
 		if ((*plugin)->hasFeature(MetaEngine::kSupportsListSaves) &&
 			(*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
-			int slot = _loadDialog->runModal(plugin, target);
+			int slot = _loadDialog->runModalWithPluginAndTarget(plugin, target);
 			if (slot >= 0) {
 				ConfMan.setActiveDomain(_domains[item]);
 				ConfMan.setInt("save_slot", slot, Common::ConfigManager::kTransientDomain);

Modified: scummvm/trunk/gui/saveload.cpp
===================================================================
--- scummvm/trunk/gui/saveload.cpp	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/gui/saveload.cpp	2011-02-07 22:58:22 UTC (rev 55815)
@@ -79,7 +79,7 @@
 SaveLoadChooser::~SaveLoadChooser() {
 }
 
-int SaveLoadChooser::runModal(const EnginePlugin *plugin, const String &target) {
+int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target) {
 	if (_gfxWidget)
 		_gfxWidget->setGfx(0);
 

Modified: scummvm/trunk/gui/saveload.h
===================================================================
--- scummvm/trunk/gui/saveload.h	2011-02-07 22:57:35 UTC (rev 55814)
+++ scummvm/trunk/gui/saveload.h	2011-02-07 22:58:22 UTC (rev 55815)
@@ -66,7 +66,7 @@
 
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 	void setList(const StringArray& list);
-	int runModal(const EnginePlugin *plugin, const String &target);
+	int runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target);
 	void open();
 
 	const Common::String &getResultString() const;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list