aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-22 18:35:30 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-22 18:35:30 +0000
commit7fd339523022aa439cdfa3203399606b30c63419 (patch)
tree5f69ecd8a35bf1627fb9c9eb806a8eb028669ac2
parent37f86c4e707fe08309e49596c9f4ff4617347c0a (diff)
downloadgnunet-gtk-7fd339523022aa439cdfa3203399606b30c63419.tar.gz
gnunet-gtk-7fd339523022aa439cdfa3203399606b30c63419.zip
LRN: two directory patches change the way "is_directory" is evaluated.
Now it must be GNUNET_YES for the execution flow to switch to a branch where something is considered to be a directory. The reason for that is that some functions might return GNUNET_SYSERR when asked whether something is a directory or not. Checking this value as "!= GNUNET_NO" will produce positive result, even though it's not a directory.
-rw-r--r--src/fs/gnunet-fs-gtk_download-save-as.c2
-rw-r--r--src/fs/gnunet-fs-gtk_event-handler.c2
-rw-r--r--src/fs/gnunet-fs-gtk_publish-dialog.c8
-rw-r--r--src/fs/gnunet-fs-gtk_publish-edit-dialog.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/src/fs/gnunet-fs-gtk_download-save-as.c b/src/fs/gnunet-fs-gtk_download-save-as.c
index 1f105879..9d54763f 100644
--- a/src/fs/gnunet-fs-gtk_download-save-as.c
+++ b/src/fs/gnunet-fs-gtk_download-save-as.c
@@ -201,7 +201,7 @@ GNUNET_FS_GTK_open_download_as_dialog (struct DownloadEntry *de)
201 set recursive 'default' value based on what the 'dc' tells us */ 201 set recursive 'default' value based on what the 'dc' tells us */
202 cb = GTK_WIDGET (gtk_builder_get_object 202 cb = GTK_WIDGET (gtk_builder_get_object
203 (dlc->builder, "GNUNET_GTK_save_as_recursive_check_button")); 203 (dlc->builder, "GNUNET_GTK_save_as_recursive_check_button"));
204 if (GNUNET_NO != de->is_directory) 204 if (GNUNET_YES == de->is_directory)
205 gtk_widget_set_sensitive (cb, TRUE); 205 gtk_widget_set_sensitive (cb, TRUE);
206 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), 206 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb),
207 de->is_recursive); 207 de->is_recursive);
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c
index 222a3f66..97592656 100644
--- a/src/fs/gnunet-fs-gtk_event-handler.c
+++ b/src/fs/gnunet-fs-gtk_event-handler.c
@@ -2073,7 +2073,7 @@ mark_download_progress (struct DownloadEntry *de,
2073 else 2073 else
2074 { 2074 {
2075 /* full completion, look at the entire file */ 2075 /* full completion, look at the entire file */
2076 if ( (GNUNET_NO != de->is_directory) && 2076 if ( (GNUNET_YES == de->is_directory) &&
2077 (filename != NULL) ) 2077 (filename != NULL) )
2078 { 2078 {
2079 struct AddDirectoryEntryContext ade; 2079 struct AddDirectoryEntryContext ade;
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c
index dd34cf88..9486d363 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -1023,7 +1023,7 @@ add_item (struct AddDirClientContext *adcc,
1023 path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), item_iter); 1023 path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), item_iter);
1024 row_reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (ts), path); 1024 row_reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (ts), path);
1025 gtk_tree_path_free (path); 1025 gtk_tree_path_free (path);
1026 if (item->is_directory) 1026 if (item->is_directory == GNUNET_YES)
1027 { 1027 {
1028 /* update meta data mime type (force to be GNUnet-directory) */ 1028 /* update meta data mime type (force to be GNUnet-directory) */
1029 if (NULL != item->meta) 1029 if (NULL != item->meta)
@@ -1088,7 +1088,7 @@ add_share_items_to_treestore (struct AddDirClientContext *adcc,
1088 { 1088 {
1089 add_item (adcc, ts, item, parent_iter, sibling_iter, &last_added); 1089 add_item (adcc, ts, item, parent_iter, sibling_iter, &last_added);
1090 sibling_iter = &last_added; 1090 sibling_iter = &last_added;
1091 if (item->is_directory) 1091 if (item->is_directory == GNUNET_YES)
1092 add_share_items_to_treestore (adcc, 1092 add_share_items_to_treestore (adcc,
1093 item->children_head, 1093 item->children_head,
1094 sibling_iter); 1094 sibling_iter);
@@ -1145,7 +1145,7 @@ directory_scan_cb (void *cls,
1145 last_pulse = GNUNET_TIME_absolute_get (); 1145 last_pulse = GNUNET_TIME_absolute_get ();
1146 } 1146 }
1147#if VERBOSE_PROGRESS 1147#if VERBOSE_PROGRESS
1148 if (is_directory) 1148 if (is_directory == GNUNET_YES)
1149 { 1149 {
1150 GNUNET_asprintf (&s, _("Scanning directory `%s'.\n"), filename); 1150 GNUNET_asprintf (&s, _("Scanning directory `%s'.\n"), filename);
1151 insert_progress_dialog_text (adcc, s); 1151 insert_progress_dialog_text (adcc, s);
@@ -1154,7 +1154,7 @@ directory_scan_cb (void *cls,
1154 else 1154 else
1155 adcc->total++; 1155 adcc->total++;
1156#else 1156#else
1157 if (! is_directory) 1157 if (is_directory != GNUNET_YES)
1158 adcc->total++; 1158 adcc->total++;
1159#endif 1159#endif
1160 break; 1160 break;
diff --git a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c
index e2056170..43e8db14 100644
--- a/src/fs/gnunet-fs-gtk_publish-edit-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-edit-dialog.c
@@ -392,7 +392,7 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb (GtkCell
392 392
393 /* However, directories must end with '/', so add it */ 393 /* However, directories must end with '/', so add it */
394 if ( (new_text[strlen (new_text) - 1] != '/') && 394 if ( (new_text[strlen (new_text) - 1] != '/') &&
395 ctx->is_directory ) 395 ctx->is_directory == GNUNET_YES)
396 { 396 {
397 char * tmp; 397 char * tmp;
398 398
@@ -1162,12 +1162,12 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkWindow * parent,
1162 1162
1163 /* indexing does not apply to directories */ 1163 /* indexing does not apply to directories */
1164 gtk_widget_set_visible (GTK_WIDGET (ctx->index_checkbutton), 1164 gtk_widget_set_visible (GTK_WIDGET (ctx->index_checkbutton),
1165 ! ctx->is_directory); 1165 ctx->is_directory != GNUNET_YES);
1166 index_label = GTK_LABEL (gtk_builder_get_object 1166 index_label = GTK_LABEL (gtk_builder_get_object
1167 (ctx->builder, 1167 (ctx->builder,
1168 "GNUNET_GTK_edit_publication_index_label")); 1168 "GNUNET_GTK_edit_publication_index_label"));
1169 gtk_widget_set_visible (GTK_WIDGET (index_label), 1169 gtk_widget_set_visible (GTK_WIDGET (index_label),
1170 ! ctx->is_directory); 1170 ctx->is_directory != GNUNET_YES);
1171 1171
1172 /* show root label only for namespaces */ 1172 /* show root label only for namespaces */
1173 gtk_widget_set_visible (GTK_WIDGET (ctx->root_entry), 1173 gtk_widget_set_visible (GTK_WIDGET (ctx->root_entry),