Use LocalFileName class for file names inside a package.

This commit is contained in:
Twan van Laarhoven
2020-04-29 23:57:36 +02:00
parent f92c09e87a
commit a1d54f36fc
19 changed files with 143 additions and 93 deletions
+2 -1
View File
@@ -12,6 +12,7 @@
#include <data/field.hpp>
#include <script/scriptable.hpp>
#include <script/image.hpp>
#include <util/io/package.hpp>
// ----------------------------------------------------------------------------- : ImageField
@@ -45,7 +46,7 @@ class ImageStyle : public Style {
class ImageValue : public Value {
public:
inline ImageValue(const ImageFieldP& field) : Value(field) {}
DECLARE_VALUE_TYPE(Image, FileName);
DECLARE_VALUE_TYPE(Image, LocalFileName);
ValueType filename; ///< Filename of the image (in the current package), or ""
Age last_update; ///< When was the image last changed?
+3 -1
View File
@@ -51,6 +51,8 @@ String SymbolValue::toString() const {
return filename.empty() ? wxEmptyString : _("<symbol>");
}
IMPLEMENT_REFLECTION_NAMELESS(SymbolValue) {
IMPLEMENT_REFLECTION_NO_GET_MEMBER(SymbolValue) {
if (fieldP->save_value || !handler.isWriting) REFLECT_NAMELESS(filename);
}
void SymbolValue::reflect(GetMember& handler) {}
void SymbolValue::reflect(GetDefaultMember& handler) {}
+2 -1
View File
@@ -11,6 +11,7 @@
#include <util/prec.hpp>
#include <data/field.hpp>
#include <script/scriptable.hpp>
#include <util/io/package.hpp>
DECLARE_POINTER_TYPE(SymbolFilter);
DECLARE_POINTER_TYPE(SymbolVariation);
@@ -65,7 +66,7 @@ class SymbolVariation : public IntrusivePtrBase<SymbolVariation> {
class SymbolValue : public Value {
public:
inline SymbolValue(const SymbolFieldP& field) : Value(field) {}
DECLARE_VALUE_TYPE(Symbol, FileName);
DECLARE_VALUE_TYPE(Symbol, LocalFileName);
ValueType filename; ///< Filename of the symbol (in the current package)
Age last_update; ///< When was the symbol last changed?