mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-26 01:11:27 -05:00
Simplify flatpak detection
This commit is contained in:
parent
7b5c8e8b31
commit
25cb1c19f4
@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import json
|
|
||||||
|
|
||||||
from onionshare import strings
|
from onionshare import strings
|
||||||
from onionshare.onion import Onion
|
from onionshare.onion import Onion
|
||||||
@ -39,16 +38,7 @@ class GuiCommon:
|
|||||||
self.local_only = local_only
|
self.local_only = local_only
|
||||||
|
|
||||||
# Are we running in a flatpak package?
|
# Are we running in a flatpak package?
|
||||||
self.is_flatpak = False
|
self.is_flatpak = os.path.exists("/.flatpak-info")
|
||||||
if os.path.exists("/app/manifest.json"):
|
|
||||||
try:
|
|
||||||
with open("/app/manifest.json") as f:
|
|
||||||
manifest_data = json.loads(f.read())
|
|
||||||
if manifest_data["id"] == "org.onionshare.OnionShare":
|
|
||||||
self.is_flatpak = True
|
|
||||||
self.common.log("GuiCommon", "__init__", "is_flatpak=True")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Load settings
|
# Load settings
|
||||||
self.common.load_settings()
|
self.common.load_settings()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user