summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-12-27 15:12:48 +0100
committerGravatar Nikias Bassen2009-12-27 15:12:48 +0100
commit82db7788d2cde9df885a9fcb2c90b87fe9a52ecf (patch)
treeb5c3380e75bf4b366e221e46d7829ade4c4916ce
parent1d807233aa6c3c5d2378b9f979af4896015b49b4 (diff)
downloadsbmanager-82db7788d2cde9df885a9fcb2c90b87fe9a52ecf.tar.gz
sbmanager-82db7788d2cde9df885a9fcb2c90b87fe9a52ecf.tar.bz2
Allow adding items to empty icon lists
-rw-r--r--src/sbmanager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c
index 5ef3d04..ed860eb 100644
--- a/src/sbmanager.c
+++ b/src/sbmanager.c
@@ -647,9 +647,13 @@ static void redraw_icons()
static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat item_x, gfloat item_y)
{
- if (!newitem || !iconlist) {
+ if (!newitem) {
return iconlist;
}
+ if (!iconlist) {
+ /* for empty lists just add the element */
+ return g_list_append(iconlist, newitem);
+ }
gint i;
gint count = g_list_length(iconlist);
gint newpos = count;
@@ -682,7 +686,7 @@ static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat ite
}
}
- return g_list_insert(iconlist, selected_item, newpos);
+ return g_list_insert(iconlist, newitem, newpos);
}
static gboolean stage_motion(ClutterActor *actor, ClutterMotionEvent *event, gpointer user_data)