aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs')
-rw-r--r--src/plugins/fs/download.c28
-rw-r--r--src/plugins/fs/meta.c6
-rw-r--r--src/plugins/fs/upload.c8
3 files changed, 21 insertions, 21 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 2a197853..cadb3f34 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -111,14 +111,14 @@ refreshDirectoryViewFromDisk(DownloadList * list) {
111 return; 111 return;
112 112
113 if (0 != stat(list->filename, 113 if (0 != stat(list->filename,
114 &buf)) 114 &buf))
115 return; 115 return;
116 if (S_ISDIR(buf.st_mode)) { 116 if (S_ISDIR(buf.st_mode)) {
117 fn = MALLOC(strlen(list->filename) + strlen(GNUNET_DIRECTORY_EXT) + 1); 117 fn = MALLOC(strlen(list->filename) + strlen(GNUNET_DIRECTORY_EXT) + 1);
118 strcpy(fn, list->filename); 118 strcpy(fn, list->filename);
119 if (fn[strlen(fn)-1] == '/') 119 if (fn[strlen(fn)-1] == '/')
120 fn[strlen(fn)-1] = '\0'; 120 fn[strlen(fn)-1] = '\0';
121 strcat(fn, GNUNET_DIRECTORY_EXT); 121 strcat(fn, GNUNET_DIRECTORY_EXT);
122 if (0 != stat(list->filename, 122 if (0 != stat(list->filename,
123 &buf)) { 123 &buf)) {
124 FREE(fn); 124 FREE(fn);
@@ -453,10 +453,10 @@ void fs_download_stopped(DownloadList * list) {
453 valid = gtk_tree_model_iter_children(model, 453 valid = gtk_tree_model_iter_children(model,
454 &iter, 454 &iter,
455 &piter); 455 &piter);
456 while (TRUE == valid) 456 while (TRUE == valid)
457 valid = gtk_tree_store_remove(GTK_TREE_STORE(model), 457 valid = gtk_tree_store_remove(GTK_TREE_STORE(model),
458 &iter); 458 &iter);
459 } 459 }
460 } 460 }
461 if (list->searchViewRowReference != NULL) { 461 if (list->searchViewRowReference != NULL) {
462 gtk_tree_row_reference_free(list->searchViewRowReference); 462 gtk_tree_row_reference_free(list->searchViewRowReference);
@@ -602,7 +602,7 @@ initiateDownload(GtkTreeModel * model,
602 if (idc_name == NULL) { 602 if (idc_name == NULL) {
603#ifdef WINDOWS 603#ifdef WINDOWS
604 char * filehash; 604 char * filehash;
605 605
606 filehash = STRDUP(sdc.uri_name); 606 filehash = STRDUP(sdc.uri_name);
607 filehash[16] = 0; 607 filehash[16] = 0;
608 idc_name = STRDUP(filehash); 608 idc_name = STRDUP(filehash);
@@ -612,7 +612,7 @@ initiateDownload(GtkTreeModel * model,
612#endif 612#endif
613 } 613 }
614 614
615 /* dname = directory portion of idc_name */ 615 /* dname = directory portion of idc_name */
616 cname = idc_name; 616 cname = idc_name;
617 dname = STRDUP(idc_name); 617 dname = STRDUP(idc_name);
618 cname = &dname[strlen(dname)-1]; 618 cname = &dname[strlen(dname)-1];
@@ -684,14 +684,14 @@ initiateDownload(GtkTreeModel * model,
684 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + 2 + 684 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + 2 +
685 strlen(idc_name) + strlen(GNUNET_DIRECTORY_EXT) + 685 strlen(idc_name) + strlen(GNUNET_DIRECTORY_EXT) +
686 strlen(dirPath)); 686 strlen(dirPath));
687 strcpy(sdc.idc_final_download_destination, 687 strcpy(sdc.idc_final_download_destination,
688 final_download_dir); 688 final_download_dir);
689 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)-1] != DIR_SEPARATOR) 689 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)-1] != DIR_SEPARATOR)
690 strcat(sdc.idc_final_download_destination, 690 strcat(sdc.idc_final_download_destination,
691 DIR_SEPARATOR_STR); 691 DIR_SEPARATOR_STR);
692 strcat(sdc.idc_final_download_destination, 692 strcat(sdc.idc_final_download_destination,
693 dirPath); 693 dirPath);
694 strcat(sdc.idc_final_download_destination, 694 strcat(sdc.idc_final_download_destination,
695 idc_name); 695 idc_name);
696 sdc.anonymity = getSpinButtonValue(sdc.searchContext->searchXML, 696 sdc.anonymity = getSpinButtonValue(sdc.searchContext->searchXML,
697 "downloadAnonymitySpinButton"); 697 "downloadAnonymitySpinButton");
@@ -777,21 +777,21 @@ void on_statusDownloadURIEntry_editing_done_fs(GtkWidget * entry,
777 disk_directory_create(ectx, final_download_dir); 777 disk_directory_create(ectx, final_download_dir);
778 dname = &uris[strlen(ECRS_URI_PREFIX) + strlen(ECRS_FILE_INFIX)]; 778 dname = &uris[strlen(ECRS_URI_PREFIX) + strlen(ECRS_FILE_INFIX)];
779 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + strlen(dname) + 2); 779 sdc.idc_final_download_destination = MALLOC(strlen(final_download_dir) + strlen(dname) + 2);
780 strcpy(sdc.idc_final_download_destination, 780 strcpy(sdc.idc_final_download_destination,
781 final_download_dir); 781 final_download_dir);
782 FREE(final_download_dir); 782 FREE(final_download_dir);
783 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)] != DIR_SEPARATOR) 783 if (sdc.idc_final_download_destination[strlen(sdc.idc_final_download_destination)] != DIR_SEPARATOR)
784 strcat(sdc.idc_final_download_destination, 784 strcat(sdc.idc_final_download_destination,
785 DIR_SEPARATOR_STR); 785 DIR_SEPARATOR_STR);
786 strcat(sdc.idc_final_download_destination, 786 strcat(sdc.idc_final_download_destination,
787 dname); 787 dname);
788 788
789 addLogEntry(_("Downloading `%s'"), 789 addLogEntry(_("Downloading `%s'"),
790 uris); 790 uris);
791 sdc.idc_meta = ECRS_createMetaData(); 791 sdc.idc_meta = ECRS_createMetaData();
792 sdc.anonymity = getSpinButtonValue(getMainXML(), 792 sdc.anonymity = getSpinButtonValue(getMainXML(),
793 "fsstatusAnonymitySpin"); 793 "fsstatusAnonymitySpin");
794 sdc.recursive = NO; 794 sdc.recursive = NO;
795 sdc.searchContext = NULL; 795 sdc.searchContext = NULL;
796 sdc.parentContext = NULL; 796 sdc.parentContext = NULL;
797 run_with_save_calls(&init_download_helper, 797 run_with_save_calls(&init_download_helper,
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c
index e7b28b68..c1665251 100644
--- a/src/plugins/fs/meta.c
+++ b/src/plugins/fs/meta.c
@@ -330,7 +330,7 @@ void handleListRemove(GladeXML * xml,
330 ggc_tree_selection_selected_foreach 330 ggc_tree_selection_selected_foreach
331 (gtk_tree_view_get_selection(GTK_TREE_VIEW(list)), 331 (gtk_tree_view_get_selection(GTK_TREE_VIEW(list)),
332 &removeRow, 332 &removeRow,
333 NULL); 333 NULL);
334} 334}
335 335
336#define THUMBSIZE 128 336#define THUMBSIZE 128
@@ -385,7 +385,7 @@ struct ECRS_MetaData * getMetaDataFromList(GladeXML * xml,
385 return meta; 385 return meta;
386 height = gdk_pixbuf_get_height(pixbuf); 386 height = gdk_pixbuf_get_height(pixbuf);
387 width = gdk_pixbuf_get_width(pixbuf); 387 width = gdk_pixbuf_get_width(pixbuf);
388 if ( (height > THUMBSIZE) || 388 if ( (height > THUMBSIZE) ||
389 (width > THUMBSIZE) ) { 389 (width > THUMBSIZE) ) {
390 if (height > THUMBSIZE) { 390 if (height > THUMBSIZE) {
391 width = width * THUMBSIZE / height; 391 width = width * THUMBSIZE / height;
@@ -622,7 +622,7 @@ const char * getEntryLineValue(GladeXML * xml,
622 const char * widgetName) { 622 const char * widgetName) {
623 GtkBin * line; 623 GtkBin * line;
624 GtkEntry * entry; 624 GtkEntry * entry;
625 625
626 line = GTK_BIN(glade_xml_get_widget(xml, 626 line = GTK_BIN(glade_xml_get_widget(xml,
627 widgetName)); 627 widgetName));
628 entry = GTK_ENTRY(gtk_bin_get_child(line)); 628 entry = GTK_ENTRY(gtk_bin_get_child(line));
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index 5ab6d75a..6d6ee123 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -142,7 +142,7 @@ fs_upload_started(struct FSUI_UploadList * fsui,
142 GtkTreePath * path; 142 GtkTreePath * path;
143 int progress; 143 int progress;
144 GtkTreeIter par; 144 GtkTreeIter par;
145 145
146 ret = MALLOC(sizeof(UploadList)); 146 ret = MALLOC(sizeof(UploadList));
147 memset(ret, 147 memset(ret,
148 0, 148 0,
@@ -163,7 +163,7 @@ fs_upload_started(struct FSUI_UploadList * fsui,
163 gtk_tree_store_append(upload_summary, 163 gtk_tree_store_append(upload_summary,
164 &iter, 164 &iter,
165 NULL); 165 NULL);
166 } 166 }
167 if (total != 0) 167 if (total != 0)
168 progress = 100 * completed / total; 168 progress = 100 * completed / total;
169 else 169 else
@@ -329,7 +329,7 @@ typedef struct {
329 329
330static void * start_upload_helper(void * cls) { 330static void * start_upload_helper(void * cls) {
331 FSUC * fsuc = cls; 331 FSUC * fsuc = cls;
332 332
333 FSUI_startUpload(ctx, 333 FSUI_startUpload(ctx,
334 fsuc->filename, 334 fsuc->filename,
335 (DirectoryScanCallback) &disk_directory_scan, 335 (DirectoryScanCallback) &disk_directory_scan,
@@ -583,7 +583,7 @@ void on_uploadFilenameComboBoxEntry_changed_fs(gpointer dummy2,
583 filename = getEntryLineValue(getMainXML(), 583 filename = getEntryLineValue(getMainXML(),
584 "uploadFilenameComboBoxEntry"); 584 "uploadFilenameComboBoxEntry");
585 ok = (0 == stat(filename, &buf)); 585 ok = (0 == stat(filename, &buf));
586 if (ok) 586 if (ok)
587 ok = (0 == ACCESS(filename, R_OK)); 587 ok = (0 == ACCESS(filename, R_OK));
588 if (ok) { 588 if (ok) {
589 if (S_ISDIR(buf.st_mode)) { 589 if (S_ISDIR(buf.st_mode)) {