summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-16 10:03:28 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-16 10:03:28 +0200
commitd51c0bcb47e199489d8c05e3a552b477c98b0ec4 (patch)
tree9b796a3cca45f1f5f732b5c28a3ed67f99eeecac
parente8f78a580ab93dfe436d5e88aaa65f4d470f017d (diff)
downloadconnman-d51c0bcb47e199489d8c05e3a552b477c98b0ec4.tar.gz
connman-d51c0bcb47e199489d8c05e3a552b477c98b0ec4.tar.bz2
connman-d51c0bcb47e199489d8c05e3a552b477c98b0ec4.zip
Some service list updates should be not delayed
-rw-r--r--src/connman.h2
-rw-r--r--src/profile.c7
-rw-r--r--src/service.c12
3 files changed, 13 insertions, 8 deletions
diff --git a/src/connman.h b/src/connman.h
index bfc7fdf9..3a6beddb 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -64,7 +64,7 @@ void __connman_profile_list(DBusMessageIter *iter);
const char *__connman_profile_active_ident(void);
const char *__connman_profile_active_path(void);
-void __connman_profile_changed(void);
+void __connman_profile_changed(gboolean delayed);
#include <connman/log.h>
diff --git a/src/profile.c b/src/profile.c
index 0f7c793f..f6ab24b4 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -96,7 +96,7 @@ static gboolean services_changed(gpointer user_data)
return FALSE;
}
-void __connman_profile_changed(void)
+void __connman_profile_changed(gboolean delayed)
{
DBG("");
@@ -110,6 +110,11 @@ void __connman_profile_changed(void)
return;
}
+ if (delayed == FALSE) {
+ services_changed(NULL);
+ return;
+ }
+
changed_timeout = g_timeout_add_seconds(2, services_changed, NULL);
}
diff --git a/src/service.c b/src/service.c
index b01ebae7..46742792 100644
--- a/src/service.c
+++ b/src/service.c
@@ -682,7 +682,7 @@ static DBusMessage *move_before(DBusConnection *conn,
g_sequence_move(src, dst);
- __connman_profile_changed();
+ __connman_profile_changed(FALSE);
return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
@@ -754,7 +754,7 @@ static void service_free(gpointer user_data)
service->path = NULL;
if (path != NULL) {
- __connman_profile_changed();
+ __connman_profile_changed(TRUE);
g_dbus_unregister_interface(connection, path,
CONNMAN_SERVICE_INTERFACE);
@@ -919,7 +919,7 @@ int connman_service_set_favorite(struct connman_service *service,
g_sequence_sort_changed(iter, service_compare, NULL);
- __connman_profile_changed();
+ __connman_profile_changed(FALSE);
return 0;
}
@@ -1036,7 +1036,7 @@ int __connman_service_indicate_state(struct connman_service *service,
if (iter != NULL)
g_sequence_sort_changed(iter, service_compare, NULL);
- __connman_profile_changed();
+ __connman_profile_changed(FALSE);
return 0;
}
@@ -1307,7 +1307,7 @@ static int service_register(struct connman_service *service)
if (iter != NULL)
g_sequence_sort_changed(iter, service_compare, NULL);
- __connman_profile_changed();
+ __connman_profile_changed(TRUE);
return 0;
}
@@ -1595,7 +1595,7 @@ struct connman_service *__connman_service_create_from_network(struct connman_net
if (service->path != NULL) {
update_from_network(service, network);
- __connman_profile_changed();
+ __connman_profile_changed(TRUE);
__connman_service_put(service);
service = NULL;