mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
separate short_name for packages, moved full_name,short_name and icon_filename to Packaged
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@173 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+15
-4
@@ -60,9 +60,6 @@ String Package::fullName() const {
|
||||
const String& Package::absoluteFilename() const {
|
||||
return filename;
|
||||
}
|
||||
InputStreamP Package::openIconFile() {
|
||||
return InputStreamP();
|
||||
}
|
||||
|
||||
|
||||
void Package::open(const String& n) {
|
||||
@@ -408,12 +405,21 @@ String Package::toStandardName(const String& name) {
|
||||
|
||||
// note: reflection must be declared before it is used
|
||||
IMPLEMENT_REFLECTION(Packaged) {
|
||||
// default does nothing
|
||||
REFLECT(short_name);
|
||||
REFLECT(full_name);
|
||||
REFLECT_N("icon", icon_filename);
|
||||
}
|
||||
|
||||
Packaged::Packaged() {
|
||||
}
|
||||
|
||||
InputStreamP Packaged::openIconFile() {
|
||||
if (!icon_filename.empty()) {
|
||||
return openIn(icon_filename);
|
||||
} else {
|
||||
return InputStreamP();
|
||||
}
|
||||
}
|
||||
void Packaged::open(const String& package) {
|
||||
Package::open(package);
|
||||
Reader reader(openIn(typeName()), absoluteFilename() + _("/") + typeName());
|
||||
@@ -436,3 +442,8 @@ void Packaged::saveAs(const String& package) {
|
||||
referenceFile(typeName());
|
||||
Package::saveAs(package);
|
||||
}
|
||||
|
||||
void Packaged::validate(Version) {
|
||||
// a default for the short name
|
||||
if (short_name.empty()) short_name = name();
|
||||
}
|
||||
Reference in New Issue
Block a user