From ad64fe145c7b4014135b36eeef80a9be487c6c72 Mon Sep 17 00:00:00 2001 From: Jorn Baayen Date: Sun, 20 May 2007 09:53:26 +0000 Subject: [PATCH] 2007-05-20 Zeeshan Ali * tools/gssdp-device-sniffer.c: (append_device), (resource_available_cb), (create_device_treemodel), (setup_treeviews): Replace 'Notify' and 'Last Notify' fields with 'First Notify'. git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/gssdp@217 d8cb91d7-bff9-0310-92b9-80b65e4482b2 --- ChangeLog | 8 ++++++++ tools/gssdp-device-sniffer.c | 31 ++++++++++--------------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6e7d09..f6f3546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-05-20 Zeeshan Ali + + * tools/gssdp-device-sniffer.c: (append_device), + (resource_available_cb), (create_device_treemodel), + (setup_treeviews): + + Replace 'Notify' and 'Last Notify' fields with 'First Notify'. + 2007-05-19 Jorn Baayen * tools/gssdp-device-sniffer.glade: diff --git a/tools/gssdp-device-sniffer.c b/tools/gssdp-device-sniffer.c index d3d9fb8..dd23e5f 100644 --- a/tools/gssdp-device-sniffer.c +++ b/tools/gssdp-device-sniffer.c @@ -272,7 +272,7 @@ find_device (GtkTreeModel *model, const char *uuid, GtkTreeIter *iter) static void append_device (const char *uuid, - const char *last_notify, + const char *first_notify, const char *device_type, const char *location) { @@ -285,26 +285,17 @@ append_device (const char *uuid, model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); g_assert (model != NULL); - if (find_device (model, uuid, &iter)) { - /* Only update the device row if it's already been added */ - gint64 notify; - - gtk_tree_model_get (model, &iter, 1, (gint64 *) ¬ify, -1); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - 1, (gint64) notify+1, - 2, last_notify, -1); - } else { + if (!find_device (model, uuid, &iter)) { gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, 0, 0, uuid, - 1, (guint64) 1, - 2, last_notify, - 4, location, -1); + 1, first_notify, + 3, location, -1); } if (device_type) { gtk_list_store_set (GTK_LIST_STORE (model), &iter, - 3, device_type, -1); + 2, device_type, -1); } } @@ -319,11 +310,11 @@ resource_available_cb (GSSDPResourceBrowser *resource_browser, char *device_type = NULL; time_t current_time; struct tm *tm; - char *last_notify; + char *first_notify; current_time = time (NULL); tm = localtime (¤t_time); - last_notify = g_strdup_printf ("%02d:%02d", + first_notify = g_strdup_printf ("%02d:%02d", tm->tm_hour, tm->tm_min); usn_tokens = g_strsplit (usn, "::", -1); @@ -343,13 +334,13 @@ resource_available_cb (GSSDPResourceBrowser *resource_browser, /* Device Announcement */ append_device (uuid, - last_notify, + first_notify, device_type, (char *) locations->data); if (device_type) g_free (device_type); - g_free (last_notify); + g_free (first_notify); g_strfreev (usn_tokens); } @@ -472,7 +463,6 @@ create_device_treemodel (void) store = gtk_list_store_new (5, G_TYPE_STRING, - G_TYPE_INT64, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); @@ -515,8 +505,7 @@ setup_treeviews () "Packet Type", "Packet Information", NULL }, {"Unique Identifier", - "Notify", - "Last Notify", + "First Notify", "Device Type", "Location", NULL } }; -- 2.7.4