linux build can now access assets in various */share/cwtch/assets folders. linux installer installs multiple sized icons
the build was successful
Details
the build was successful
Details
This commit is contained in:
bovenliggende
4cdb507e5e
commit
4bb5a52b9f
|
@ -2,7 +2,7 @@
|
|||
Name=Cwtch
|
||||
Comment=Metadata Resistant Instant Messaging
|
||||
Exec=~/.local/bin/cwtch
|
||||
Icon=~/.local/share/icons/cwtch.png
|
||||
Icon=cwtch
|
||||
StartupNotify=true
|
||||
Type=Application
|
||||
Keywords=Internet;IM;Instant Messaging;Messaging;Chat
|
||||
|
|
BIN
linux/cwtch.png
BIN
linux/cwtch.png
Binair bestand niet weergegeven.
Voor Breedte: | Hoogte: | Grootte: 3.9 KiB |
Binair bestand niet weergegeven.
Na Breedte: | Hoogte: | Grootte: 9.4 KiB |
Binair bestand niet weergegeven.
Na Breedte: | Hoogte: | Grootte: 798 B |
Binair bestand niet weergegeven.
Na Breedte: | Hoogte: | Grootte: 1.9 KiB |
Binair bestand niet weergegeven.
Na Breedte: | Hoogte: | Grootte: 2.9 KiB |
Binair bestand niet weergegeven.
Na Breedte: | Hoogte: | Grootte: 4.0 KiB |
|
@ -6,5 +6,10 @@ cp ui ~/.local/bin/cwtch
|
|||
mkdir -p ~/.local/share/icons
|
||||
cp cwtch.png ~/.local/share/icons
|
||||
|
||||
mkdir -p ~/.local/share/cwtch
|
||||
cp -r assets ~/.local/share/cwtch
|
||||
|
||||
cp -r icons ~/.local/share/
|
||||
|
||||
mkdir -p ~/.local/share/applications
|
||||
sed "s|~|$HOME|" cwtch.desktop > $HOME/.local/share/applications/cwtch.desktop
|
||||
|
|
32
main.go
32
main.go
|
@ -181,14 +181,38 @@ func mainUi(flagLocal bool, flagClientUI bool) {
|
|||
log.Infof("core.QCoreApplication_ApplicationDirPath(): %v\n", dir)
|
||||
if runtime.GOOS == "android" {
|
||||
gcd.SetAssetPath("assets:/")
|
||||
} else {
|
||||
} else if runtime.GOOS == "windows" {
|
||||
// all of these access are QML based, and QML takes URIs which use forward slashes and translates them to local OS sperators
|
||||
// also windows paths need to be like /c:/PATH
|
||||
if runtime.GOOS == "windows" {
|
||||
dir = "/" + dir
|
||||
}
|
||||
dir = "/" + dir
|
||||
// QML uses '/' regardless of platform (so we use path.Join here not filepath.Join)
|
||||
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||
} else {
|
||||
if buildVer == "" || flagLocal {
|
||||
if _, err := os.Stat(path.Join(dir, "assets")); !os.IsNotExist(err) {
|
||||
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||
}
|
||||
} else {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
log.Errorf("\nerror: could not load current user: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
localCwtch := path.Join(usr.HomeDir, ".local/share/cwtch")
|
||||
if _, err := os.Stat(localCwtch); !os.IsNotExist(err) {
|
||||
gcd.SetAssetPath("file://" + path.Join(localCwtch, "assets") + "/")
|
||||
} else if _, err := os.Stat("/usr/share/cwtch"); !os.IsNotExist(err) {
|
||||
gcd.SetAssetPath("file://" + "/usr/share/cwtch/assets/")
|
||||
} else if _, err := os.Stat("/usr/local/share/cwtch/"); !os.IsNotExist(err) {
|
||||
gcd.SetAssetPath("file://" + "/usr/local/share/cwtch/assets/")
|
||||
} else if _, err := os.Stat(path.Join(dir, "assets")); !os.IsNotExist(err) {
|
||||
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||
}
|
||||
}
|
||||
if gcd.AssetPath() == "" {
|
||||
log.Errorf("Could not find assets folder")
|
||||
os.Exit(-1)
|
||||
}
|
||||
}
|
||||
log.Infof("gcd.assetPath = '%v'\n", gcd.AssetPath())
|
||||
|
||||
|
|
Verwijs in nieuw issue