removed OnInit again

This commit is contained in:
Roland Singer
2019-01-20 15:11:42 +01:00
parent bd566dda7b
commit 64f3fa620e
2 changed files with 0 additions and 30 deletions
-24
View File
@@ -62,7 +62,6 @@ type app struct {
argv **C.char
mutex sync.Mutex
initFuncs []func() error
ctxPropMap map[string]interface{}
imgProvMap map[string]*ImageProvider
}
@@ -169,14 +168,6 @@ func (a *app) getDp() (dp float64, err error) {
dp = dpi / 140.0*/
}
// OnInit calls the function during application initialization.
// The qml data is already loaded, but the application does not run yet.
func (a *app) OnInit(f func() error) {
a.mutex.Lock()
a.initFuncs = append(a.initFuncs, f)
a.mutex.Unlock()
}
// RunMain runs the function on the applications main thread.
func (a *app) RunMain(f func()) {
// Check if already running on the main thread.
@@ -283,21 +274,6 @@ func (a *app) Exec(url string) (retCode int, err error) {
return
}
// Call all init functions.
var initFuncs []func() error
a.mutex.Lock()
initFuncs = a.initFuncs
a.initFuncs = nil
a.mutex.Unlock()
for _, f := range initFuncs {
err = f()
if err != nil {
err = fmt.Errorf("gml: onInit: %v", err)
return
}
}
// Execute the app.
apiErr := errorPool.Get()
defer errorPool.Put(apiErr)
-6
View File
@@ -51,12 +51,6 @@ func init() {
}
}
// OnInit calls the function during application initialization.
// The qml data is already loaded, but the application does not run yet.
func OnInit(f func() error) {
gapp.OnInit(f)
}
// RunMain runs the function on the applications main thread.
func RunMain(f func()) {
gapp.RunMain(f)