From c2bca5939d1d78d1548fcd43c29390fb06a508c0 Mon Sep 17 00:00:00 2001 From: Maran Date: Wed, 9 Jul 2014 14:01:53 +0200 Subject: [PATCH] Added path check for Windows when loading external QML windows/components --- ethereal/qml_container.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ethereal/qml_container.go b/ethereal/qml_container.go index a8ce1cb75..cb43a99bd 100644 --- a/ethereal/qml_container.go +++ b/ethereal/qml_container.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "github.com/go-qml/qml" + "runtime" ) type QmlApplication struct { @@ -20,7 +21,14 @@ func NewQmlApplication(path string, lib *UiLib) *QmlApplication { } func (app *QmlApplication) Create() error { - component, err := app.engine.LoadFile(app.path) + path := string(app.path) + + // For some reason for windows we get /c:/path/to/something, windows doesn't like the first slash but is fine with the others so we are removing it + if string(app.path[0]) == "/" && runtime.GOOS == "windows" { + path = app.path[1:] + } + + component, err := app.engine.LoadFile(path) if err != nil { logger.Warnln(err) }