gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27904 - gnunet-gtk/src/setup


From: gnunet
Subject: [GNUnet-SVN] r27904 - gnunet-gtk/src/setup
Date: Thu, 11 Jul 2013 13:18:59 +0200

Author: grothoff
Date: 2013-07-11 13:18:59 +0200 (Thu, 11 Jul 2013)
New Revision: 27904

Modified:
   gnunet-gtk/src/setup/gnunet-setup-gns.c
Log:
-handle user adding same name twice

Modified: gnunet-gtk/src/setup/gnunet-setup-gns.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup-gns.c     2013-07-11 11:11:44 UTC (rev 
27903)
+++ gnunet-gtk/src/setup/gnunet-setup-gns.c     2013-07-11 11:18:59 UTC (rev 
27904)
@@ -1282,6 +1282,8 @@
   GtkTreeIter it;
   gboolean not_dummy;
   char *name;
+  struct RecordInfo *ri;
+  struct GNUNET_HashCode name_hash;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
              "New text for `%s' is `%s'\n", 
@@ -1306,7 +1308,22 @@
   GNUNET_break (! not_dummy);
   GNUNET_break (0 == strcmp (name, _(NEW_NAME_STR)));
   g_free (name);
+  
+  GNUNET_CRYPTO_hash (new_text, strlen (new_text), &name_hash);
+  ri = GNUNET_CONTAINER_multihashmap_get (n2r,
+                                         &name_hash);
+  if (NULL != ri)
+  {
+    GtkTreeSelection *sel;
+    GtkTreePath *sel_path;
 
+    sel_path = gtk_tree_row_reference_get_path (ri->rr);
+    sel = gtk_tree_view_get_selection(tv);
+    gtk_tree_selection_select_path (sel, sel_path);
+    gtk_tree_path_free (sel_path);
+    return;
+  }
+
   /* change dummy line to new name, then add new dummy */
   gtk_tree_store_set (ts, &it,
                      GNS_TREESTORE_COL_NAME, new_text,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]