linux: Only use Gtk.ShowUri in flatpaks
This commit is contained in:
parent
942441696b
commit
6514d71190
|
@ -103,7 +103,7 @@ namespace SparkleShare {
|
||||||
Xalign = 0, Xpad = 0
|
Xalign = 0, Xpad = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (InstallationInfo.Directory.StartsWith ("/app", StringComparison.InvariantCulture))
|
if (InstallationInfo.IsFlatpak)
|
||||||
version.Text += " (Flatpak)";
|
version.Text += " (Flatpak)";
|
||||||
|
|
||||||
updates = new Label ("Checking for updates…") {
|
updates = new Label ("Checking for updates…") {
|
||||||
|
|
|
@ -98,7 +98,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override void OpenFile (string path)
|
public override void OpenFile (string path)
|
||||||
{
|
{
|
||||||
Global.ShowUri (Gdk.Screen.Default, path);
|
if (InstallationInfo.IsFlatpak)
|
||||||
|
Global.ShowUri (Gdk.Screen.Default, path);
|
||||||
|
else
|
||||||
|
new Command ("xdg-open", string.Format ("\"{0}\"", path)).Start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,3 +120,4 @@ namespace SparkleShare
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,5 +95,12 @@ namespace Sparkles {
|
||||||
return version.Substring (0, version.Length - 2);
|
return version.Substring (0, version.Length - 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool IsFlatpak {
|
||||||
|
get {
|
||||||
|
return Directory.StartsWith ("/app", StringComparison.InvariantCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue