Commit 2acdf5c0 authored by Martin Krohn's avatar Martin Krohn
parent 1f86036a
Pipeline #264 passed with stages
in 1 minute and 11 seconds
...@@ -1072,14 +1072,14 @@ xfce_appfinder_model_history_insert (XfceAppfinderModel *model, ...@@ -1072,14 +1072,14 @@ xfce_appfinder_model_history_insert (XfceAppfinderModel *model,
/* add new command */ /* add new command */
item = g_slice_new0 (ModelItem); item = g_slice_new0 (ModelItem);
item->command = g_strdup (command); item->command = g_strdup (command);
item->icon = GDK_PIXBUF (g_object_ref (G_OBJECT (model->command_icon)));
item->icon_large = GDK_PIXBUF (g_object_ref (G_OBJECT (model->command_icon_large)));
if (g_slist_find_custom (model->items, item, xfce_appfinder_model_item_compare) != NULL) if (g_slist_find_custom (model->items, item, xfce_appfinder_model_item_compare) != NULL)
{ {
APPFINDER_DEBUG ("Skip adding %s to the model as it's already contained.", command); APPFINDER_DEBUG ("Skip adding %s to the model as it's already contained.", command);
g_slice_free (ModelItem, item); g_slice_free (ModelItem, item);
return FALSE; return FALSE;
} }
item->icon = GDK_PIXBUF (g_object_ref (G_OBJECT (model->command_icon)));
item->icon_large = GDK_PIXBUF (g_object_ref (G_OBJECT (model->command_icon_large)));
model->items = g_slist_insert_sorted (model->items, item, xfce_appfinder_model_item_compare); model->items = g_slist_insert_sorted (model->items, item, xfce_appfinder_model_item_compare);
/* find the item and the position */ /* find the item and the position */
...@@ -2249,7 +2249,6 @@ xfce_appfinder_model_save_command (XfceAppfinderModel *model, ...@@ -2249,7 +2249,6 @@ xfce_appfinder_model_save_command (XfceAppfinderModel *model,
GSList *li; GSList *li;
GString *contents; GString *contents;
gboolean succeed = FALSE; gboolean succeed = FALSE;
gboolean inserted = FALSE;
gchar *filename; gchar *filename;
ModelItem *item; ModelItem *item;
static gsize old_len = 0; static gsize old_len = 0;
...@@ -2260,9 +2259,8 @@ xfce_appfinder_model_save_command (XfceAppfinderModel *model, ...@@ -2260,9 +2259,8 @@ xfce_appfinder_model_save_command (XfceAppfinderModel *model,
if (!IS_STRING (command)) if (!IS_STRING (command))
return TRUE; return TRUE;
/* add command to the model */ /* add command to the model if command does not exist in the history, else just return */
inserted = xfce_appfinder_model_history_insert (model, command); if (!xfce_appfinder_model_history_insert (model, command))
if (!inserted)
return TRUE; return TRUE;
/* add to the hashtable */ /* add to the hashtable */
......
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