[Scummvm-cvs-logs] SF.net SVN: scummvm:[48923] scummvm/trunk/base/commandLine.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon May 3 21:18:55 CEST 2010
Revision: 48923
http://scummvm.svn.sourceforge.net/scummvm/?rev=48923&view=rev
Author: lordhoto
Date: 2010-05-03 19:18:55 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Show the user a nice message, when the target passed to --list-saves does not allow listing of its save states.
This is a first step into implementing FR #2988017
"exit status with --list-saves always 0".
Modified Paths:
--------------
scummvm/trunk/base/commandLine.cpp
Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp 2010-05-03 18:51:06 UTC (rev 48922)
+++ scummvm/trunk/base/commandLine.cpp 2010-05-03 19:18:55 UTC (rev 48923)
@@ -631,17 +631,22 @@
return;
}
- // Query the plugin for a list of savegames
- SaveStateList saveList = (*plugin)->listSaves(target);
+ if (!(*plugin)->hasFeature(MetaEngine::kSupportsListSaves)) {
+ // TODO: Include more info about the target (desc, engine name, ...) ???
+ printf("Target '%s' does not support listing of its save states.\n", target);
+ } else {
+ // Query the plugin for a list of savegames
+ SaveStateList saveList = (*plugin)->listSaves(target);
- // TODO: Include more info about the target (desc, engine name, ...) ???
- printf("Saves for target '%s':\n", target);
- printf(" Slot Description \n"
- " ---- ------------------------------------------------------\n");
+ // TODO: Include more info about the target (desc, engine name, ...) ???
+ printf("Saves for target '%s':\n", target);
+ printf(" Slot Description \n"
+ " ---- ------------------------------------------------------\n");
- for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) {
- printf(" %-4s %s\n", x->save_slot().c_str(), x->description().c_str());
- // TODO: Could also iterate over the full hashmap, printing all key-value pairs
+ for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) {
+ printf(" %-4s %s\n", x->save_slot().c_str(), x->description().c_str());
+ // TODO: Could also iterate over the full hashmap, printing all key-value pairs
+ }
}
// Revert to the old active domain
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