aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-02-11 04:55:06 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-02-22 23:47:45 +0800
commit75e3424275e8d45268bdf8c48e9be9dc23b4f713 (patch)
treeb94215c07295679ca08ff9dafb4c8871e35a50e3 /embed
parent4561a7ace83312a59f29e956d76a6c93cd4f9bcb (diff)
downloadgsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar.gz
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar.bz2
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar.lz
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar.xz
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.tar.zst
gsoc2013-epiphany-75e3424275e8d45268bdf8c48e9be9dc23b4f713.zip
ephy-web-app-utils: be more careful listing applications
Check if the .desktop file exists to prevent false positives. https://bugzilla.gnome.org/show_bug.cgi?id=669836
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-app-utils.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/embed/ephy-web-app-utils.c b/embed/ephy-web-app-utils.c
index b9447c385..6c3c4d327 100644
--- a/embed/ephy-web-app-utils.c
+++ b/embed/ephy-web-app-utils.c
@@ -384,7 +384,6 @@ ephy_web_application_get_application_list ()
GDate *date;
char *desktop_file, *desktop_file_path;
char *contents;
- GFile *file;
GFileInfo *desktop_info;
app = g_slice_new0 (EphyWebApplication);
@@ -399,6 +398,7 @@ ephy_web_application_get_application_list ()
char **strings;
GKeyFile *key;
int i;
+ GFile *file;
key = g_key_file_new ();
g_key_file_load_from_data (key, contents, -1, 0, NULL);
@@ -412,27 +412,28 @@ ephy_web_application_get_application_list ()
g_strfreev (strings);
g_free (exec);
g_key_file_free (key);
+
+ file = g_file_new_for_path (desktop_file_path);
+
+ /* FIXME: this should use TIME_CREATED but it does not seem to be working. */
+ desktop_info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, 0, NULL, NULL);
+ created = g_file_info_get_attribute_uint64 (desktop_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+
+ date = g_date_new ();
+ g_date_set_time_t (date, (time_t)created);
+ g_date_strftime (app->install_date, 127, "%x", date);
+
+ g_date_free (date);
+ g_object_unref (file);
+ g_object_unref (desktop_info);
+
+ applications = g_list_append (applications, app);
}
g_free (contents);
g_free (desktop_file);
g_free (profile_dir);
-
- file = g_file_new_for_path (desktop_file_path);
g_free (desktop_file_path);
-
- /* FIXME: this should use TIME_CREATED but it does not seem to be working. */
- desktop_info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, 0, NULL, NULL);
- created = g_file_info_get_attribute_uint64 (desktop_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
- date = g_date_new ();
- g_date_set_time_t (date, (time_t)created);
- g_date_strftime (app->install_date, 127, "%x", date);
- g_date_free (date);
- g_object_unref (file);
- g_object_unref (desktop_info);
-
- applications = g_list_append (applications, app);
-
}
g_object_unref (info);