Skip to content

Commit

Permalink
[appsync] sort appsync list alphabetically. Contributes: JB#30264
Browse files Browse the repository at this point in the history
Seems files do not get sorted and read out alphabetically always,
so sort the list to make sure they are.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jul 2, 2015
1 parent 58b9863 commit 22c9f93
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/usb_moded-appsync.c
Expand Up @@ -76,6 +76,11 @@ void free_appsync_list(void)
}
}

static gint list_sort_func(gconstpointer a, gconstpointer b)
{
return strcasecmp( (char*)a, (char*)b );
}

void readlist(int diag)
{
GDir *confdir = 0;
Expand Down Expand Up @@ -106,6 +111,10 @@ void readlist(int diag)
cleanup:
if( confdir ) g_dir_close(confdir);

/* sort list alphabetically so services for a mode
can be run in a certain order */
sync_list=g_list_sort(sync_list, list_sort_func);

/* set up session bus connection if app sync in use
* so we do not need to make the time consuming connect
* operation at enumeration time ... */
Expand Down

0 comments on commit 22c9f93

Please sign in to comment.