From: Marcel Holtmann Date: Thu, 6 Aug 2009 06:27:03 +0000 (-0700) Subject: Fix missing service type ordering X-Git-Tag: 2.0_alpha~3356 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eee49d1f27121885ea80ee8ceb3bc3bf8d777298;p=framework%2Fconnectivity%2Fconnman.git Fix missing service type ordering --- diff --git a/src/service.c b/src/service.c index 587fe45..fb95cf0 100644 --- a/src/service.c +++ b/src/service.c @@ -1009,6 +1009,20 @@ static gint service_compare(gconstpointer a, gconstpointer b, if (service_a->favorite == FALSE && service_b->favorite == TRUE) return 1; + if (service_a->type != service_b->type) { + switch (service_a->type) { + case CONNMAN_SERVICE_TYPE_UNKNOWN: + case CONNMAN_SERVICE_TYPE_ETHERNET: + break; + case CONNMAN_SERVICE_TYPE_WIFI: + return 1; + case CONNMAN_SERVICE_TYPE_WIMAX: + case CONNMAN_SERVICE_TYPE_BLUETOOTH: + case CONNMAN_SERVICE_TYPE_CELLULAR: + return -1; + } + } + return (gint) service_b->strength - (gint) service_a->strength; }