mirror of
https://github.com/gosticks/gml.git
synced 2025-10-16 12:05:33 +00:00
add application version
This commit is contained in:
parent
a5bb930680
commit
b14a2f95d1
9
app.go
9
app.go
@ -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 ###//
|
||||
//#####################//
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user