diff options
author | Maran <maran.hidskes@gmail.com> | 2014-07-09 20:01:53 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-07-09 20:01:53 +0800 |
commit | c2bca5939d1d78d1548fcd43c29390fb06a508c0 (patch) | |
tree | 903deae1408b72f3d11c06a7401bbe1a9a15b550 /ethereal | |
parent | 05c18998959b6fbc5da674489371a8d3e88e7db2 (diff) | |
download | go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar.gz go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar.bz2 go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar.lz go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar.xz go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.tar.zst go-tangerine-c2bca5939d1d78d1548fcd43c29390fb06a508c0.zip |
Added path check for Windows when loading external QML windows/components
Diffstat (limited to 'ethereal')
-rw-r--r-- | ethereal/qml_container.go | 10 |
1 files changed, 9 insertions, 1 deletions
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) } |