compatibility with older wxWidgets versions

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1441 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-07-21 13:20:24 +00:00
parent 80f815b9ce
commit 35f5de2800
+5 -1
View File
@@ -23,7 +23,11 @@ class MSE2FileFormat : public FileFormat {
virtual bool canExport(const Game&) { return true; }
virtual SetP importSet(const String& filename) {
wxString set_name = filename;
filename.EndsWith(_("/set"), &set_name);
// Strip "/set" from the end, newer wx versions have a function for this:
// filename.EndsWith(_("/set"), &set_name);
if (filename.size() > 4 && filename.substr(filename.size()-4) == _("/set")) {
set_name = filename.substr(0, filename.size()-4);
}
SetP set(new Set);
set->open(set_name);
settings.addRecentFile(set_name);