From 64f3fa620e40bc9c17e89a52838bc5fdd0a6fe84 Mon Sep 17 00:00:00 2001 From: Roland Singer Date: Sun, 20 Jan 2019 15:11:42 +0100 Subject: [PATCH] removed OnInit again --- app.go | 24 ------------------------ gml.go | 6 ------ 2 files changed, 30 deletions(-) diff --git a/app.go b/app.go index 35cc652..8129eb6 100644 --- a/app.go +++ b/app.go @@ -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) diff --git a/gml.go b/gml.go index 7da7b86..a6f4f88 100644 --- a/gml.go +++ b/gml.go @@ -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)