forked from cwtch.im/ui
Merge branch 'androiddir' of dan/ui into master
This commit is contained in:
commit
091fb1f296
8
main.go
8
main.go
|
@ -22,6 +22,8 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
const androidBaseDir = "/data/data/org.qtproject.example.go/"
|
||||
|
||||
func init() {
|
||||
// make go-defined types available in qml
|
||||
gothings.GrandCentralDispatcher_QmlRegisterType2("CustomQmlTypes", 1, 0, "GrandCentralDispatcher")
|
||||
|
@ -35,7 +37,6 @@ func main() {
|
|||
log.SetLevel(log.LevelInfo)
|
||||
}
|
||||
|
||||
|
||||
// our globals
|
||||
gcd := gothings.NewGrandCentralDispatcher(nil)
|
||||
gcd.UIState = gothings.NewUIState(gcd)
|
||||
|
@ -53,7 +54,6 @@ func main() {
|
|||
qmlSource = core.NewQUrl3("qrc:/qml/main.qml", 0)
|
||||
}
|
||||
|
||||
|
||||
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
||||
app.SetWindowIcon(gui.NewQIcon5(":/qml/images/cwtch-icon.png"))
|
||||
|
||||
|
@ -72,6 +72,8 @@ func main() {
|
|||
|
||||
if os.Getenv("CWTCH_FOLDER") != "" {
|
||||
the.CwtchDir = os.Getenv("CWTCH_FOLDER")
|
||||
} else if runtime.GOOS == "android" {
|
||||
the.CwtchDir = path.Join(androidBaseDir, "files")
|
||||
} else {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
|
@ -83,7 +85,7 @@ func main() {
|
|||
|
||||
torpath := "tor"
|
||||
if runtime.GOOS == "android" {
|
||||
torpath = "/data/data/org.qtproject.example.go/lib/libtor.so"
|
||||
torpath = path.Join(androidBaseDir, "lib/libtor.so")
|
||||
} else {
|
||||
dir, _ := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if _, err := os.Stat(path.Join(dir, "tor")); os.IsNotExist(err) {
|
||||
|
|
Loading…
Reference in New Issue