portal support: Read /.flatpak-info

The flatpak-info file was moved to a different location a while
ago, we should read it from there instead of relying on the
compat symlink. One advantage is that this is a fixed, short
path, we don't have to construct one dynamically.

https://bugzilla.gnome.org/show_bug.cgi?id=781826
This commit is contained in:
Matthias Clasen 2017-04-27 07:22:18 -04:00
parent 84134c64ed
commit 82e31de04d

View File

@ -27,15 +27,12 @@ static gboolean network_available;
static void
read_flatpak_info (void)
{
char *path;
if (flatpak_info_read)
return;
flatpak_info_read = TRUE;
path = g_build_filename (g_get_user_runtime_dir (), "flatpak-info", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS))
{
GKeyFile *keyfile;
@ -66,8 +63,6 @@ read_flatpak_info (void)
use_portal = TRUE;
network_available = TRUE;
}
g_free (path);
}
gboolean