[Scummvm-cvs-logs] SF.net SVN: scummvm:[52437] scummvm/trunk/engines/sci/engine/kfile.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Aug 29 13:08:27 CEST 2010
Revision: 52437
http://scummvm.svn.sourceforge.net/scummvm/?rev=52437&view=rev
Author: thebluegr
Date: 2010-08-29 11:08:27 +0000 (Sun, 29 Aug 2010)
Log Message:
-----------
SCI: Throw a warning in QFG import screens for unmatched files
The original SCI games supported up to 12 characters for file names, thus we
use the file name returned as a mask to find the actual file, as we don't
wrap/unwrap save file names in these screens. If no files match, or if more
than 1 files match, throw a warning.
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kfile.cpp
Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp 2010-08-29 10:39:34 UTC (rev 52436)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp 2010-08-29 11:08:27 UTC (rev 52437)
@@ -823,7 +823,16 @@
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
Common::StringArray saveNames = saveFileMan->listSavefiles(pattern);
- name = saveNames.size() > 0 ? saveNames[0] : name;
+
+ // There should be exactly one match for this search, otherwise throw a warning
+ if (saveNames.size() == 0) {
+ warning("QFG No matches for %s", pattern.c_str());
+ } else if (saveNames.size() == 1) {
+ name = saveNames[0];
+ } else {
+ warning("More than 1 matches for %s, using the first one", pattern.c_str());
+ name = saveNames[0];
+ }
}
return file_open(s, name.c_str(), mode);
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