Commit 45167e9f authored by Jim Krehl's avatar Jim Krehl

svn path=/branches/openSUSE-10.3/; revision=355



svn path=/branches/openSUSE-10.3/; revision=355
parent 7dffeee5
......@@ -826,75 +826,43 @@ load_recent_store (BookmarkAgent *this)
{
BookmarkAgentPrivate *priv = PRIVATE (this);
#ifdef USE_GTK_RECENT_MANAGER
GtkRecentInfo *info;
gboolean include;
#else
EggRecentModel *model;
EggRecentItem *info;
#endif
GBookmarkFile *store;
GList *items;
GList *items_ordered = NULL;
gchar **uris = NULL;
GList *items_ordered = NULL;
BookmarkItem *item;
GList *node;
gboolean include;
gint i;
GList *node;
#ifdef USE_GTK_RECENT_MANAGER
items = gtk_recent_manager_get_items (gtk_recent_manager_get_default ());
#else
model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
if (priv->type == BOOKMARK_STORE_RECENT_APPS)
egg_recent_model_set_filter_groups (model, "recently-used-apps", NULL);
else
egg_recent_model_set_filter_groups (model, NULL);
items = egg_recent_model_get_list (model);
#endif
store = g_bookmark_file_new ();
g_bookmark_file_load_from_file (store, priv->store_path, NULL);
for (node = items; node; node = node->next) {
#ifdef USE_GTK_RECENT_MANAGER
info = (GtkRecentInfo *) node->data;
uris = g_bookmark_file_get_uris (store, NULL);
for (i = 0; uris && uris [i]; ++i) {
if (priv->type == BOOKMARK_STORE_RECENT_APPS)
include = gtk_recent_info_has_group (info, "recently-used-apps");
include = g_bookmark_file_has_group (store, uris [i], "recently-used-apps", NULL);
else
include = ! gtk_recent_info_get_private_hint (info);
include = ! g_bookmark_file_get_is_private (store, uris [i], NULL);
if (include) {
item = g_new0 (BookmarkItem, 1);
item->uri = g_strdup (gtk_recent_info_get_uri (info));
item->mime_type = g_strdup (gtk_recent_info_get_mime_type (info));
item->mtime = gtk_recent_info_get_modified (info);
item->uri = g_strdup (uris [i]);
item->mime_type = g_bookmark_file_get_mime_type (store, uris [i], NULL);
item->mtime = g_bookmark_file_get_modified (store, uris [i], NULL);
items_ordered = g_list_insert_sorted (items_ordered, item, recent_item_mru_comp_func);
}
gtk_recent_info_unref (info);
#else
info = (EggRecentItem *) node->data;
item = g_new0 (BookmarkItem, 1);
item->uri = egg_recent_item_get_uri (info);
item->mime_type = egg_recent_item_get_mime_type (info);
item->mtime = egg_recent_item_get_timestamp (info);
items_ordered = g_list_append (items_ordered, item);
egg_recent_item_unref (info);
#endif
}
g_list_free (items);
#ifndef USE_GTK_RECENT_MANAGER
g_object_unref (model);
#endif
g_strfreev (uris);
g_bookmark_file_free (store);
g_bookmark_file_free (priv->store);
priv->store = g_bookmark_file_new ();
......@@ -946,9 +914,8 @@ update_user_spec_path (BookmarkAgent *this)
if (use_user_path)
path = g_strdup (priv->user_store_path);
else {
else
path = find_package_data_file (priv->store_filename);
}
if (use_user_path)
status = BOOKMARK_STORE_USER;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment