diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2019-03-16 10:56:30 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2019-03-20 09:21:52 -0500 |
commit | 735cbedcf0eb8587f06e19d6445ae9a8dda16d8d (patch) | |
tree | be4209060f218086957cac5988dd578a9db2fa98 /lib/ephy-web-app-utils.c | |
parent | 1cd0fc7fafcd185118482bee94f5f92f2d8b7260 (diff) | |
download | epiphany-735cbedcf0eb8587f06e19d6445ae9a8dda16d8d.tar.gz |
web-app-utils: Stop looking under old profile dir for web apps
This code doesn't make any sense because web apps are no longer stored
under the default profile dir. It's also probably harmless, because the
code should not be called except when running the default browser
instance with the default profile dir, in which case it already behaved
properly, but still, it's weird and confusing and should be removed.
Diffstat (limited to 'lib/ephy-web-app-utils.c')
-rw-r--r-- | lib/ephy-web-app-utils.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c index fbb7554cd..f9cbece40 100644 --- a/lib/ephy-web-app-utils.c +++ b/lib/ephy-web-app-utils.c @@ -560,22 +560,18 @@ ephy_web_application_get_application_list_internal (gboolean only_legacy) GFileEnumerator *children = NULL; GFileInfo *info; GList *applications = NULL; - GFile *dot_dir; - char *default_dot_dir; - g_autofree char *profile_base = NULL; - - default_dot_dir = !ephy_profile_dir_is_default () ? ephy_default_profile_dir () : NULL; - if (only_legacy) { - profile_base = g_build_filename (g_get_user_config_dir (), "epiphany", NULL); - dot_dir = g_file_new_for_path (profile_base); - } else { - profile_base = g_strdup (g_get_user_data_dir ()); - dot_dir = g_file_new_for_path (default_dot_dir ? default_dot_dir : g_get_user_data_dir ()); - } - children = g_file_enumerate_children (dot_dir, + g_autofree char *parent_directory_path = NULL; + g_autoptr(GFile) parent_directory = NULL; + + if (only_legacy) + parent_directory_path = g_build_filename (g_get_user_config_dir (), "epiphany", NULL); + else + parent_directory_path = g_strdup (g_get_user_data_dir ()); + + parent_directory = g_file_new_for_path (parent_directory_path); + children = g_file_enumerate_children (parent_directory, "standard::name", 0, NULL, NULL); - g_object_unref (dot_dir); info = g_file_enumerator_next_file (children, NULL, NULL); while (info) { @@ -587,7 +583,7 @@ ephy_web_application_get_application_list_internal (gboolean only_legacy) EphyWebApplication *app; char *profile_dir; - profile_dir = g_build_filename (profile_base, name, NULL); + profile_dir = g_build_filename (parent_directory_path, name, NULL); app = ephy_web_application_for_profile_directory (profile_dir); if (app) { if (!only_legacy) { @@ -609,7 +605,6 @@ ephy_web_application_get_application_list_internal (gboolean only_legacy) } g_object_unref (children); - g_free (default_dot_dir); return g_list_reverse (applications); } |