add application version

This commit is contained in:
Sebastian 2020-02-21 10:41:19 +01:00
parent a5bb930680
commit b14a2f95d1
3 changed files with 23 additions and 0 deletions

9
app.go
View File

@ -315,6 +315,15 @@ func (a *app) SetOrganizationName(name string) {
})
}
func (a *app) SetApplicationVersion(version string) {
versionC := C.CString(version)
defer C.free(unsafe.Pointer(versionC))
a.RunMain(func() {
C.gml_app_set_application_version(a.app, versionC)
})
}
//#####################//
//### Exported to C ###//
//#####################//

View File

@ -57,6 +57,7 @@ int gml_app_set_root_context_property_object(gml_app app, const char* name,
int gml_app_set_root_context_property_variant(gml_app app, const char* name, gml_variant gml_v, gml_error err);
void gml_app_set_application_name(gml_app app, const char* name);
void gml_app_set_organization_name(gml_app app, const char* name);
void gml_app_set_application_version(gml_app app, const char* version);
double gml_app_get_dp(gml_app app, gml_error err);

View File

@ -239,6 +239,19 @@ void gml_app_set_organization_name(gml_app app, const char* name) {
}
}
void gml_app_set_application_version(gml_app app, const char* version) {
try {
GmlApp* a = (GmlApp*)app;
a->app.setApplicationVersion(QString(version));
}
catch (std::exception& e) {
gml_error_log_exception(e.what());
}
catch (...) {
gml_error_log_exception();
}
}
double gml_app_get_dp(gml_app app, gml_error err) {
try {
GmlApp* a = (GmlApp*)app;