service: Update service order when changing the favorite flag
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 10 Oct 2011 16:12:35 +0000 (18:12 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 10 Oct 2011 16:31:23 +0000 (18:31 +0200)
If the service order is not changed at the same time as the favorite
status, the service may stay on top of the service list despite not
being a favorite anymore.

Patch based on an initial fix from Danny Jeongseok Seo <s.seo@samsung.com>.

src/service.c

index dc89078..c135f42 100644 (file)
@@ -3797,6 +3797,7 @@ int __connman_service_set_favorite(struct connman_service *service,
                return -EALREADY;
 
        service->favorite = favorite;
+       service->order = __connman_service_get_order(service);
 
        favorite_changed(service);