Diff between 529790b6a5d599b961469a7c800b164a2e5d3388 and 203f5cb2f03c3708bb79cecb8b448b87e3ce7c88

Changed Files

File Additions Deletions Status
client/gatt.c +2 -17 modified
gdbus/client.c +0 -1 modified

Full Patch

diff --git a/client/gatt.c b/client/gatt.c
index 3d0222e..4d51e05 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -445,28 +445,13 @@ GDBusProxy *gatt_select_attribute(GDBusProxy *parent, const char *arg)
 
 static char *attribute_generator(const char *text, int state, GList *source)
 {
-	static int index, len;
-	GList *list;
+	static int index;
 
 	if (!state) {
 		index = 0;
-		len = strlen(text);
 	}
 
-	for (list = g_list_nth(source, index); list;
-						list = g_list_next(list)) {
-		GDBusProxy *proxy = list->data;
-		const char *path;
-
-		index++;
-
-		path = g_dbus_proxy_get_path(proxy);
-
-		if (!strncmp(path, text, len))
-			return strdup(path);
-        }
-
-	return NULL;
+	return g_dbus_proxy_path_lookup(source, &index, text);
 }
 
 char *gatt_attribute_generator(const char *text, int state)
diff --git a/gdbus/client.c b/gdbus/client.c
index 9364be7..eaab7d5 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -384,7 +384,6 @@ char *g_dbus_proxy_path_lookup(GList *list, int *index, const char *path)
 
 	for (l = g_list_nth(list, index ? *index : 0); l; l = g_list_next(l)) {
 		GDBusProxy *proxy = l->data;
-
 		const char *proxy_path = g_dbus_proxy_get_path(proxy);
 
 		if (index)