expose folder_name package property

This commit is contained in:
GenevensiS
2025-06-12 22:59:36 +02:00
parent a401d68c9b
commit 337f463b9a
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -567,6 +567,7 @@ template <> void Writer::handle(const PackageDependency& dep) {
IMPLEMENT_REFLECTION(Packaged) {
REFLECT(short_name);
REFLECT(full_name);
REFLECT(folder_name);
REFLECT_N("icon", icon_filename);
REFLECT_NO_SCRIPT(position_hint);
REFLECT(installer_group);
@@ -648,10 +649,11 @@ void Packaged::saveCopy(const String& package) {
}
void Packaged::validate(Version) {
folder_name = name();
// a default for the short name
if (short_name.empty()) {
if (!full_name.empty()) short_name = full_name;
short_name = name();
else short_name = folder_name;
}
// check dependencies
FOR_EACH(dep, dependencies) {
+1
View File
@@ -271,6 +271,7 @@ public:
String installer_group; ///< Group to place this package in in the installer
String short_name; ///< Short name of this package
String full_name; ///< Name of this package, for menus etc.
String folder_name; ///< Name of the folder this package is loaded from.
String icon_filename; ///< Filename of icon to use in package lists
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
int position_hint; ///< A hint for the package list