From 7af4d63ea872609a9d7c2f9d954a211bded1b5bb Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Mon, 8 Feb 2021 20:34:42 +0100 Subject: [style] cleanup - remove unused debug - uncomment notification function, leftover from debug - comment about go-land mutexes --- gui/qml/main.qml | 2 -- pkg/backend/status.go | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gui/qml/main.qml b/gui/qml/main.qml index 4189e27..3ddf8d3 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -181,14 +181,12 @@ ApplicationWindow { // Helper to show notification messages function showNotification(msg) { console.log("Going to show notification message: ", msg); - /* if (supportsMessages) { let appname = ctx ? ctx.appName: "VPN"; showMessage(appname, msg, null, 15000); } else { console.log("System doesn't support systray notifications"); } - */ } menu: Menu { diff --git a/pkg/backend/status.go b/pkg/backend/status.go index f793e2f..16db227 100644 --- a/pkg/backend/status.go +++ b/pkg/backend/status.go @@ -5,7 +5,6 @@ import ( "encoding/json" "log" "sync" - "fmt" // DEBUG "0xacab.org/leap/bitmask-vpn/pkg/bitmask" "0xacab.org/leap/bitmask-vpn/pkg/config" @@ -19,13 +18,14 @@ const ( failedStr = "failed" ) -var statusMutex sync.Mutex -var updateMutex sync.Mutex - // ctx will be our glorious global object. // if we ever switch again to a provider-agnostic app, we should keep a map here. var ctx *connectionCtx +// these mutexes protect setting and updating the global status in this go backend +var statusMutex sync.Mutex +var updateMutex sync.Mutex + // The connectionCtx keeps the global state that is passed around to C-land. It // also serves as the primary way of passing requests from the frontend to the // Go-core, by letting the UI write some of these variables and processing @@ -57,7 +57,6 @@ func (c connectionCtx) toJson() ([]byte, error) { log.Println(err) return nil, err } - fmt.Println(">>> ctx toJson done") return b, nil } -- cgit v1.2.3