gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13411 - gnunet-gtk/src


From: gnunet
Subject: [GNUnet-SVN] r13411 - gnunet-gtk/src
Date: Wed, 27 Oct 2010 00:38:40 +0200

Author: grothoff
Date: 2010-10-27 00:38:40 +0200 (Wed, 27 Oct 2010)
New Revision: 13411

Modified:
   gnunet-gtk/src/main_window_file_publish.c
Log:
remove migrated keywords

Modified: gnunet-gtk/src/main_window_file_publish.c
===================================================================
--- gnunet-gtk/src/main_window_file_publish.c   2010-10-26 22:29:39 UTC (rev 
13410)
+++ gnunet-gtk/src/main_window_file_publish.c   2010-10-26 22:38:40 UTC (rev 
13411)
@@ -606,6 +606,26 @@
 
 
 /**
+ * Remove  the keyword from the ksk URI.
+ *
+ * @param cls the ksk uri
+ * @param keyword the word to remove
+ * @param is_mandatory ignored
+ * @return always GNUNET_OK
+ */
+static int
+remove_keyword (void *cls,
+               const char *keyword,
+               int is_mandatory)
+{
+  struct GNUNET_FS_Uri *ksk = cls;
+  
+  GNUNET_FS_uri_ksk_remove_keyword (ksk, keyword);
+  return GNUNET_OK;
+}
+
+
+/**
  * Add the specifics of the given entry to the tree store.
  * Derive KSK from the given meta data, but exclude meta
  * data given in "md_no_ksk" for keyword generation.
@@ -629,13 +649,14 @@
                 int do_index,
                 struct GNUNET_CONTAINER_MetaData *md_no_ksk,
                 struct GNUNET_CONTAINER_MetaData *meta)
-{
+{  
   char *file_size_fancy;
   struct GNUNET_FS_FileInformation *fi;
   GtkTreeRowReference *row_reference;
   GtkTreePath *path;
   uint64_t file_size;
   struct GNUNET_FS_Uri *ksk_uri;
+  struct GNUNET_FS_Uri *kill_ksk;
   const char *ss;
   const char *short_fn;
   struct stat sbuf;
@@ -658,8 +679,11 @@
        }
     }
   ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (meta);
-  /* FIXME: modify ksk_uri based on md_no_ksk
-     => need additional fs_uri API function! */
+  kill_ksk = GNUNET_FS_uri_ksk_create_from_meta_data (md_no_ksk);
+  GNUNET_FS_uri_ksk_get_keywords (kill_ksk,
+                                 &remove_keyword,
+                                 ksk_uri);
+  GNUNET_FS_uri_destroy (kill_ksk);
   path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts),
                                  iter);
   row_reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (ts),
@@ -671,8 +695,9 @@
                                         EXTRACTOR_METATYPE_MIMETYPE,
                                         NULL, 0);
       GNUNET_FS_meta_data_make_directory (meta);
-      /* FIXME: add application/gnunet-directory to 
-        ksk_uri! => need additional fs_uri API function! */
+      GNUNET_FS_uri_ksk_add_keyword (ksk_uri,
+                                    GNUNET_FS_DIRECTORY_MIME,
+                                    GNUNET_NO);
     }
   fi = GNUNET_FS_file_information_create_from_file (GNUNET_GTK_get_fs_handle 
(),
                                                    row_reference,




reply via email to

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