gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19168 - gnunet-gtk/src/fs


From: gnunet
Subject: [GNUnet-SVN] r19168 - gnunet-gtk/src/fs
Date: Sun, 15 Jan 2012 21:44:50 +0100

Author: grothoff
Date: 2012-01-15 21:44:50 +0100 (Sun, 15 Jan 2012)
New Revision: 19168

Modified:
   gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c
Log:
-DCE

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c  2012-01-15 
20:41:56 UTC (rev 19167)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk-main_window_file_publish.c  2012-01-15 
20:44:50 UTC (rev 19168)
@@ -274,89 +274,6 @@
 
 
 /**
- * Add a file to the tree model.
- *
- * @param filename file to add
- * @param bo block options to use
- * @param do_index should we index or insert?
- * @param iter parent entry, or NULL for top-level addition
- */
-// FIXME: are we keeping this around for a reason?
-/* static */ void
-add_file_at_iter (struct MainPublishingDialogContext *ctx, const char 
*filename,
-                  const struct GNUNET_FS_BlockOptions *bo, int do_index,
-                  GtkTreeIter * iter)
-{
-  struct GNUNET_FS_FileInformation *fi;
-  GtkTreeRowReference *row_reference;
-  GtkTreePath *path;
-  uint64_t file_size;
-  const char *short_fn;
-  struct GNUNET_CONTAINER_MetaData *meta;
-  struct GNUNET_FS_Uri *ksk_uri;
-  GtkTreeIter pos;
-  char *file_size_fancy;
-  const char *ss;
-  struct stat sbuf;
-
-  /* TODO: make directory scanner capable of scanning single files and use
-   * it instead
-   */
-
-  if (0 != STAT (filename, &sbuf))
-    return;
-  if (S_ISDIR (sbuf.st_mode))
-  {
-    file_size = 0;
-  }
-  else
-  {
-    if (GNUNET_OK != GNUNET_DISK_file_size (filename, &file_size, GNUNET_YES))
-    {
-      GNUNET_break (0);
-      return;
-    }
-  }
-
-  meta = GNUNET_CONTAINER_meta_data_create ();
-  GNUNET_FS_meta_data_extract_from_file (meta, filename,
-                                         GNUNET_FS_GTK_get_le_plugins ());
-  GNUNET_CONTAINER_meta_data_delete (meta, EXTRACTOR_METATYPE_FILENAME, NULL,
-                                     0);
-  short_fn = filename;
-  while (NULL != (ss = strstr (short_fn, DIR_SEPARATOR_STR)))
-    short_fn = 1 + ss;
-  GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet-gtk>",
-                                     EXTRACTOR_METATYPE_FILENAME,
-                                     EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                     short_fn, strlen (short_fn) + 1);
-  ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (meta);
-  gtk_tree_store_insert_before (GTK_TREE_STORE (ctx->file_info_treemodel), 
&pos, iter, NULL);
-  path = gtk_tree_model_get_path (ctx->file_info_treemodel, &pos);
-  row_reference = gtk_tree_row_reference_new (ctx->file_info_treemodel, path);
-  gtk_tree_path_free (path);
-  fi = GNUNET_FS_file_information_create_from_file (GNUNET_FS_GTK_get_fs_handle
-                                                    (), row_reference, 
filename,
-                                                    ksk_uri, meta, do_index,
-                                                    bo);
-  GNUNET_CONTAINER_meta_data_destroy (meta);
-  GNUNET_FS_uri_destroy (ksk_uri);
-  if (S_ISDIR (sbuf.st_mode))
-    file_size_fancy = GNUNET_strdup (MARKER_DIR_FILE_SIZE);
-  else
-    file_size_fancy = GNUNET_STRINGS_byte_size_fancy (file_size);
-  gtk_tree_store_set (GTK_TREE_STORE (ctx->file_info_treemodel), &pos, 0, 
file_size_fancy, 1, (gboolean) do_index, 2,
-                      short_fn, 3, (guint) bo->anonymity_level, 4,
-                      (guint) bo->content_priority, 5, fi,
-                     6, (guint64) bo->expiration_time.abs_value,
-                     7, (guint) bo->replication_level,
-                     -1);
-  GNUNET_free (file_size_fancy);
-  update_selectivity (ctx);
-}
-
-
-/**
  * Add an empty directory to the tree model.
  *
  * @param name name for the directory




reply via email to

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