summaryrefslogtreecommitdiff
path: root/pkg/backend
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/backend')
-rw-r--r--pkg/backend/api.go7
-rw-r--r--pkg/backend/init.go8
2 files changed, 14 insertions, 1 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index 7c049fc..7aa5527 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -85,6 +85,11 @@ func RefreshContext() *C.char {
return C.CString(string(c))
}
+func ResetError(errname string) {
+ log.Println("DEBUG: resetting error", errname)
+ resetErrors(errname)
+}
+
func InstallHelpers() {
pickle.InstallHelpers()
}
@@ -105,7 +110,7 @@ func EnableWebAPI(port string) {
/* these two are a bit redundant since we already add them to ctx. however, we
want to have them available before everything else, to be able to parse cli
arguments. In the long run, we probably want to move all vendoring to qt, so
- this probably should not live in the backend. */
+ this probably should not live in the backend, see #326*/
func GetVersion() *C.char {
return C.CString(version.VERSION)
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index bae9b9b..af43bab 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -34,11 +34,19 @@ func initializeContext(opts *InitOpts) {
func checkErrors(errCh chan string) {
for {
err := <-errCh
+ // TODO consider a queue instead
ctx.Errors = err
go trigger(OnStatusChanged)
}
}
+func resetErrors(errname string) {
+ if ctx.Errors == errname {
+ ctx.Errors = ""
+ log.Println("DEBUG: reset error", errname)
+ }
+}
+
func initializeBitmask(errCh chan string, opts *InitOpts) {
if ctx == nil {
log.Println("bug: cannot initialize bitmask, ctx is nil!")