]> err.no Git - libchamplain/commitdiff
Simply prepend the markers when selected
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Tue, 28 Jul 2009 20:57:57 +0000 (22:57 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:32:22 +0000 (17:32 -0400)
champlain/champlain-selection-layer.c

index c444e3935db68ebf7c28d4ba7e248184cfc09929..2f6ecef58227e7b44471ccef736352621f8ebe04 100644 (file)
@@ -123,17 +123,12 @@ champlain_selection_layer_class_init (ChamplainSelectionLayerClass *klass)
 
 static void
 marker_select (ChamplainSelectionLayer *layer,
-    ChamplainBaseMarker *marker,
-    gboolean prepend)
+    ChamplainBaseMarker *marker)
 {
-
   /* Add selection */
   g_object_ref (marker);
   g_object_set (marker, "highlighted", TRUE, NULL);
-  if (prepend)
-    layer->priv->selection = g_list_prepend (layer->priv->selection, marker);
-  else
-    layer->priv->selection = g_list_append (layer->priv->selection, marker);
+  layer->priv->selection = g_list_prepend (layer->priv->selection, marker);
 }
 
 static void
@@ -149,10 +144,10 @@ api_select (ChamplainSelectionLayer *layer,
     {
       /* Clear previous selection */
       champlain_selection_layer_unselect_all (layer);
-      marker_select (layer, marker, TRUE);
+      marker_select (layer, marker);
     }
   else if (layer->priv->mode == CHAMPLAIN_SELECTION_MULTIPLE)
-    marker_select (layer, marker, FALSE);
+    marker_select (layer, marker);
 }
 
 static void
@@ -166,7 +161,7 @@ mouse_select (ChamplainSelectionLayer *layer,
     {
       /* Clear previous selection */
       champlain_selection_layer_unselect_all (layer);
-      marker_select (layer, marker, TRUE);
+      marker_select (layer, marker);
     }
   else if (layer->priv->mode == CHAMPLAIN_SELECTION_MULTIPLE)
     {
@@ -179,7 +174,7 @@ mouse_select (ChamplainSelectionLayer *layer,
           return;
         }
 
-      marker_select (layer, marker, FALSE);
+      marker_select (layer, marker);
     }
 }