aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/daemon/daemon.c2
-rw-r--r--src/plugins/fs/download.c62
-rw-r--r--src/plugins/fs/fs.c8
-rw-r--r--src/plugins/fs/fs.h2
-rw-r--r--src/plugins/fs/helper.h2
-rw-r--r--src/plugins/fs/meta.c10
-rw-r--r--src/plugins/fs/meta.h4
-rw-r--r--src/plugins/fs/namespace.c10
-rw-r--r--src/plugins/fs/search.c38
-rw-r--r--src/plugins/fs/search.h2
-rw-r--r--src/plugins/fs/upload.c26
-rw-r--r--src/plugins/fs/upload.h2
-rw-r--r--src/plugins/stats/functions.c6
-rw-r--r--src/plugins/stats/statistics.c6
14 files changed, 90 insertions, 90 deletions
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c
index 4004f3f4..27b95cfd 100644
--- a/src/plugins/daemon/daemon.c
+++ b/src/plugins/daemon/daemon.c
@@ -56,7 +56,7 @@ static void * updateAppModelSafe(void * unused) {
56 G_TYPE_STRING); 56 G_TYPE_STRING);
57 apps = NULL; 57 apps = NULL;
58 sock = client_connection_create(ectx, cfg); 58 sock = client_connection_create(ectx, cfg);
59 if (sock != NULL) 59 if (sock != NULL)
60 apps = getConfigurationOptionValue(sock, 60 apps = getConfigurationOptionValue(sock,
61 "GNUNETD", 61 "GNUNETD",
62 "APPLICATIONS"); 62 "APPLICATIONS");
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 19b2f73a..c7ed4d18 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -33,12 +33,12 @@
33/* ****************** FSUI download events ****************** */ 33/* ****************** FSUI download events ****************** */
34 34
35/** 35/**
36 * We are iterating over the contents of a 36 * We are iterating over the contents of a
37 * directory. Add the list of entries to 37 * directory. Add the list of entries to
38 * the search page at the position indicated 38 * the search page at the position indicated
39 * by the download list. 39 * by the download list.
40 */ 40 */
41static int 41static int
42addFilesToDirectory(const ECRS_FileInfo * fi, 42addFilesToDirectory(const ECRS_FileInfo * fi,
43 const HashCode512 * key, 43 const HashCode512 * key,
44 int isRoot, 44 int isRoot,
@@ -50,7 +50,7 @@ addFilesToDirectory(const ECRS_FileInfo * fi,
50 GtkTreePath * path; 50 GtkTreePath * path;
51 GtkTreeModel * model; 51 GtkTreeModel * model;
52 52
53 if (isRoot == YES) 53 if (isRoot == YES)
54 return OK; 54 return OK;
55 if (! gtk_tree_row_reference_valid(list->searchViewRowReference)) 55 if (! gtk_tree_row_reference_valid(list->searchViewRowReference))
56 return SYSERR; 56 return SYSERR;
@@ -91,7 +91,7 @@ addFilesToDirectory(const ECRS_FileInfo * fi,
91 return OK; 91 return OK;
92} 92}
93 93
94static void 94static void
95refreshDirectoryViewFromDisk(DownloadList * list) { 95refreshDirectoryViewFromDisk(DownloadList * list) {
96 unsigned long long size; 96 unsigned long long size;
97 char * data; 97 char * data;
@@ -101,18 +101,18 @@ refreshDirectoryViewFromDisk(DownloadList * list) {
101 if ( (list->is_directory != YES) || 101 if ( (list->is_directory != YES) ||
102 (list->searchList == NULL) || 102 (list->searchList == NULL) ||
103 (list->searchViewRowReference == NULL) || 103 (list->searchViewRowReference == NULL) ||
104 (! gtk_tree_row_reference_valid(list->searchViewRowReference)) ) 104 (! gtk_tree_row_reference_valid(list->searchViewRowReference)) )
105 return; 105 return;
106 106
107 if (OK != disk_file_size(ectx, 107 if (OK != disk_file_size(ectx,
108 list->filename, 108 list->filename,
109 &size, 109 &size,
110 YES)) 110 YES))
111 return; 111 return;
112 fd = disk_file_open(ectx, 112 fd = disk_file_open(ectx,
113 list->filename, 113 list->filename,
114 O_RDONLY); 114 O_RDONLY);
115 if (fd == -1) 115 if (fd == -1)
116 return; 116 return;
117 data = MMAP(NULL, 117 data = MMAP(NULL,
118 size, 118 size,
@@ -168,7 +168,7 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
168 char * uri_name; 168 char * uri_name;
169 gboolean valid; 169 gboolean valid;
170 struct ECRS_URI * u; 170 struct ECRS_URI * u;
171 171
172 /* setup visualization */ 172 /* setup visualization */
173 list = MALLOC(sizeof(DownloadList)); 173 list = MALLOC(sizeof(DownloadList));
174 memset(list, 174 memset(list,
@@ -201,7 +201,7 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
201 DOWNLOAD_HSIZE, size_h, 201 DOWNLOAD_HSIZE, size_h,
202 DOWNLOAD_PROGRESS, progress, 202 DOWNLOAD_PROGRESS, progress,
203 DOWNLOAD_URISTRING, uri_name, 203 DOWNLOAD_URISTRING, uri_name,
204 DOWNLOAD_INTERNAL, list, 204 DOWNLOAD_INTERNAL, list,
205 -1); 205 -1);
206 FREE(uri_name); 206 FREE(uri_name);
207 FREE(size_h); 207 FREE(size_h);
@@ -221,16 +221,16 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
221 path = gtk_tree_row_reference_get_path(dl_parent->searchViewRowReference); 221 path = gtk_tree_row_reference_get_path(dl_parent->searchViewRowReference);
222 valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(sl_parent->tree), 222 valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(sl_parent->tree),
223 &piter, 223 &piter,
224 path); 224 path);
225 if (valid == TRUE) 225 if (valid == TRUE)
226 valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(sl_parent->tree), 226 valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(sl_parent->tree),
227 &iter, 227 &iter,
228 &piter); 228 &piter);
229 } else { 229 } else {
230 /* must be top-level entry in search */ 230 /* must be top-level entry in search */
231 valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(sl_parent->tree), 231 valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(sl_parent->tree),
232 &iter); 232 &iter);
233 } 233 }
234 if (valid == TRUE) { 234 if (valid == TRUE) {
235 valid = FALSE; 235 valid = FALSE;
236 /* find matching entry */ 236 /* find matching entry */
@@ -271,7 +271,7 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
271 list->next = download_head; 271 list->next = download_head;
272 download_head = list; 272 download_head = list;
273 if ( (list->is_directory == YES) && 273 if ( (list->is_directory == YES) &&
274 (completed != 0) ) 274 (completed != 0) )
275 refreshDirectoryViewFromDisk(list); 275 refreshDirectoryViewFromDisk(list);
276 return list; 276 return list;
277} 277}
@@ -306,7 +306,7 @@ void fs_download_update(DownloadList * list,
306 (list->searchList != NULL) && 306 (list->searchList != NULL) &&
307 (list->searchViewRowReference != NULL) ) { 307 (list->searchViewRowReference != NULL) ) {
308 struct ECRS_MetaData * meta; 308 struct ECRS_MetaData * meta;
309 309
310 meta = NULL; 310 meta = NULL;
311 ECRS_listDirectory(ectx, 311 ECRS_listDirectory(ectx,
312 data, 312 data,
@@ -353,17 +353,17 @@ void fs_download_stopped(DownloadList * list) {
353 &iter, 353 &iter,
354 path); 354 path);
355 gtk_tree_path_free(path); 355 gtk_tree_path_free(path);
356 gtk_tree_row_reference_free(list->summaryViewRowReference); 356 gtk_tree_row_reference_free(list->summaryViewRowReference);
357 list->summaryViewRowReference = NULL; 357 list->summaryViewRowReference = NULL;
358 gtk_tree_store_remove(download_summary, 358 gtk_tree_store_remove(download_summary,
359 &iter); 359 &iter);
360 if (list->searchViewRowReference != NULL) { 360 if (list->searchViewRowReference != NULL) {
361 gtk_tree_row_reference_free(list->searchViewRowReference); 361 gtk_tree_row_reference_free(list->searchViewRowReference);
362 list->searchViewRowReference = NULL; 362 list->searchViewRowReference = NULL;
363 } 363 }
364 FREE(list->filename); 364 FREE(list->filename);
365 ECRS_freeUri(list->uri); 365 ECRS_freeUri(list->uri);
366 366
367 if (download_head == list) 367 if (download_head == list)
368 download_head = list->next; 368 download_head = list->next;
369 else { 369 else {
@@ -388,7 +388,7 @@ void fs_download_stopped(DownloadList * list) {
388 * 388 *
389 * @return OK if no download is pending, SYSERR if 389 * @return OK if no download is pending, SYSERR if
390 * such a download is already active. 390 * such a download is already active.
391 */ 391 */
392static int 392static int
393check_pending(const char * filename, 393check_pending(const char * filename,
394 GtkTreeIter * parent) { 394 GtkTreeIter * parent) {
@@ -421,7 +421,7 @@ check_pending(const char * filename,
421 * The user clicked the download button. 421 * The user clicked the download button.
422 * Start the download of the selected entry. 422 * Start the download of the selected entry.
423 */ 423 */
424static void 424static void
425initiateDownload(GtkTreeModel * model, 425initiateDownload(GtkTreeModel * model,
426 GtkTreePath * path, 426 GtkTreePath * path,
427 GtkTreeIter * iter, 427 GtkTreeIter * iter,
@@ -485,7 +485,7 @@ initiateDownload(GtkTreeModel * model,
485#else 485#else
486 idc_name = uri_name; 486 idc_name = uri_name;
487#endif 487#endif
488 } 488 }
489 cname = idc_name; 489 cname = idc_name;
490 oname = idc_name; 490 oname = idc_name;
491 dname = MALLOC(strlen(idc_name)+1); 491 dname = MALLOC(strlen(idc_name)+1);
@@ -570,12 +570,12 @@ initiateDownload(GtkTreeModel * model,
570 strcat(idc_final_download_destination, idc_name); 570 strcat(idc_final_download_destination, idc_name);
571 if ( (idc_final_download_destination[strlen(idc_final_download_destination) - 1] == '/') || 571 if ( (idc_final_download_destination[strlen(idc_final_download_destination) - 1] == '/') ||
572 (idc_final_download_destination[strlen(idc_final_download_destination) - 1] == '\\') ) 572 (idc_final_download_destination[strlen(idc_final_download_destination) - 1] == '\\') )
573 idc_final_download_destination[strlen(idc_final_download_destination) - 1] = '\0'; 573 idc_final_download_destination[strlen(idc_final_download_destination) - 1] = '\0';
574 /* append ".gnd" if needed (== directory and .gnd not present) */ 574 /* append ".gnd" if needed (== directory and .gnd not present) */
575 if ( (idc_mime != NULL) && 575 if ( (idc_mime != NULL) &&
576 (0 == strcmp(idc_mime, GNUNET_DIRECTORY_MIME)) && 576 (0 == strcmp(idc_mime, GNUNET_DIRECTORY_MIME)) &&
577 ( (strlen(idc_final_download_destination) < strlen(GNUNET_DIRECTORY_EXT)) || 577 ( (strlen(idc_final_download_destination) < strlen(GNUNET_DIRECTORY_EXT)) ||
578 (0 != strcmp(&idc_final_download_destination[strlen(idc_final_download_destination) 578 (0 != strcmp(&idc_final_download_destination[strlen(idc_final_download_destination)
579 - strlen(GNUNET_DIRECTORY_EXT)], 579 - strlen(GNUNET_DIRECTORY_EXT)],
580 GNUNET_DIRECTORY_EXT)) ) ) 580 GNUNET_DIRECTORY_EXT)) ) )
581 strcat(idc_final_download_destination, GNUNET_DIRECTORY_EXT); 581 strcat(idc_final_download_destination, GNUNET_DIRECTORY_EXT);
@@ -626,7 +626,7 @@ void on_downloadButton_clicked_fs(GtkWidget * treeview,
626 * that is NOT rooted within a search or directory. 626 * that is NOT rooted within a search or directory.
627 * 627 *
628 * TODO: 628 * TODO:
629 * - support for recursive downloads 629 * - support for recursive downloads
630 * - support for showing directories (if downloaded like this) 630 * - support for showing directories (if downloaded like this)
631 * - support for user-specified filename 631 * - support for user-specified filename
632 */ 632 */
@@ -639,7 +639,7 @@ void on_statusDownloadURIEntry_editing_done_fs(GtkWidget * entry,
639 char * urid; 639 char * urid;
640 char * final_download_dir; 640 char * final_download_dir;
641 const char * dname; 641 const char * dname;
642 642
643 uris = gtk_entry_get_text(GTK_ENTRY(entry)); 643 uris = gtk_entry_get_text(GTK_ENTRY(entry));
644 urid = STRDUP(uris); 644 urid = STRDUP(uris);
645 gtk_entry_set_text(GTK_ENTRY(entry), 645 gtk_entry_set_text(GTK_ENTRY(entry),
@@ -703,7 +703,7 @@ static void * fsui_callback(void * cls) {
703 return NULL; 703 return NULL;
704} 704}
705 705
706static gboolean 706static gboolean
707clearCompletedDownloadCallback(GtkTreeModel * model, 707clearCompletedDownloadCallback(GtkTreeModel * model,
708 GtkTreePath * path, 708 GtkTreePath * path,
709 GtkTreeIter * iter, 709 GtkTreeIter * iter,
@@ -727,13 +727,13 @@ clearCompletedDownloadCallback(GtkTreeModel * model,
727} 727}
728 728
729void on_clearCompletedDownloadsButton_clicked_fs(void * unused, 729void on_clearCompletedDownloadsButton_clicked_fs(void * unused,
730 GtkWidget * clearButton) { 730 GtkWidget * clearButton) {
731 gtk_tree_model_foreach(GTK_TREE_MODEL(download_summary), 731 gtk_tree_model_foreach(GTK_TREE_MODEL(download_summary),
732 &clearCompletedDownloadCallback, 732 &clearCompletedDownloadCallback,
733 NULL); 733 NULL);
734} 734}
735 735
736static void 736static void
737fsuiCallDownloadCallback(GtkTreeModel * model, 737fsuiCallDownloadCallback(GtkTreeModel * model,
738 GtkTreePath * path, 738 GtkTreePath * path,
739 GtkTreeIter * iter, 739 GtkTreeIter * iter,
diff --git a/src/plugins/fs/fs.c b/src/plugins/fs/fs.c
index bd651ecf..0c18fa7b 100644
--- a/src/plugins/fs/fs.c
+++ b/src/plugins/fs/fs.c
@@ -195,7 +195,7 @@ saveEventProcessor(void * cls) {
195 return ret; 195 return ret;
196} 196}
197 197
198static void * 198static void *
199eventProcessor(void * unused, 199eventProcessor(void * unused,
200 const FSUI_Event * event) { 200 const FSUI_Event * event) {
201 return gtkSaveCall(&saveEventProcessor, 201 return gtkSaveCall(&saveEventProcessor,
@@ -204,7 +204,7 @@ eventProcessor(void * unused,
204 204
205/** 205/**
206 * Setup the summary views (in particular the models 206 * Setup the summary views (in particular the models
207 * and the renderers). 207 * and the renderers).
208 */ 208 */
209static void fs_summary_start() { 209static void fs_summary_start() {
210 GtkComboBoxEntry * searchCB; 210 GtkComboBoxEntry * searchCB;
@@ -221,7 +221,7 @@ static void fs_summary_start() {
221 searchCB 221 searchCB
222 = GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(getMainXML(), 222 = GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(getMainXML(),
223 "fssearchKeywordComboBoxEntry")); 223 "fssearchKeywordComboBoxEntry"));
224 224
225 model = gtk_list_store_new(NS_SEARCH_NUM, 225 model = gtk_list_store_new(NS_SEARCH_NUM,
226 G_TYPE_STRING, /* what we show */ 226 G_TYPE_STRING, /* what we show */
227 G_TYPE_STRING, /* EncName of namespace */ 227 G_TYPE_STRING, /* EncName of namespace */
@@ -314,7 +314,7 @@ static void fs_summary_start() {
314 renderer, 314 renderer,
315 "text", DOWNLOAD_HSIZE, 315 "text", DOWNLOAD_HSIZE,
316 NULL); 316 NULL);
317 317
318 column = gtk_tree_view_get_column(downloadList, 318 column = gtk_tree_view_get_column(downloadList,
319 col - 1); 319 col - 1);
320 gtk_tree_view_column_set_resizable(column, TRUE); 320 gtk_tree_view_column_set_resizable(column, TRUE);
diff --git a/src/plugins/fs/fs.h b/src/plugins/fs/fs.h
index 88a1f59a..e859d12f 100644
--- a/src/plugins/fs/fs.h
+++ b/src/plugins/fs/fs.h
@@ -199,7 +199,7 @@ typedef struct SL {
199 /** 199 /**
200 * FSUI search handle. 200 * FSUI search handle.
201 */ 201 */
202 struct FSUI_SearchList * fsui_list; 202 struct FSUI_SearchList * fsui_list;
203} SearchList; 203} SearchList;
204 204
205 205
diff --git a/src/plugins/fs/helper.h b/src/plugins/fs/helper.h
index d70fc6e2..f91940a8 100644
--- a/src/plugins/fs/helper.h
+++ b/src/plugins/fs/helper.h
@@ -36,7 +36,7 @@
36 * @returns the created widget to pack into the page header 36 * @returns the created widget to pack into the page header
37 */ 37 */
38GtkWidget * 38GtkWidget *
39buildSearchTabLabel(GtkWidget *searchPage, 39buildSearchTabLabel(GtkWidget *searchPage,
40 const char *title); 40 const char *title);
41 41
42 42
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c
index 28fa7cb1..d6014697 100644
--- a/src/plugins/fs/meta.c
+++ b/src/plugins/fs/meta.c
@@ -172,7 +172,7 @@ void createKeywordListTreeView(GladeXML * xml,
172 GtkListStore * keymodel; 172 GtkListStore * keymodel;
173 GtkCellRenderer * renderer; 173 GtkCellRenderer * renderer;
174 GtkTreeViewColumn * column; 174 GtkTreeViewColumn * column;
175 175
176 DEBUG_BEGIN(); 176 DEBUG_BEGIN();
177 keymodel 177 keymodel
178 = gtk_list_store_new(1, 178 = gtk_list_store_new(1,
@@ -482,7 +482,7 @@ unsigned int getSpinButtonValue(GladeXML * xml,
482 482
483char * getMimeTypeFromMetaData(const struct ECRS_MetaData * meta) { 483char * getMimeTypeFromMetaData(const struct ECRS_MetaData * meta) {
484 char * mime; 484 char * mime;
485 485
486 mime = ECRS_getFromMetaData(meta, 486 mime = ECRS_getFromMetaData(meta,
487 EXTRACTOR_MIMETYPE); 487 EXTRACTOR_MIMETYPE);
488 if (mime == NULL) 488 if (mime == NULL)
@@ -507,7 +507,7 @@ char * getFileNameFromMetaData(const struct ECRS_MetaData * meta) {
507 name = STRDUP(_("no name given")); 507 name = STRDUP(_("no name given"));
508 } else { 508 } else {
509 char * dotdot; 509 char * dotdot;
510 510
511 while (NULL != (dotdot = strstr(name, ".."))) 511 while (NULL != (dotdot = strstr(name, "..")))
512 dotdot[0] = dotdot[1] = '_'; 512 dotdot[0] = dotdot[1] = '_';
513 } 513 }
@@ -537,7 +537,7 @@ GdkPixbuf * getThumbnailFromMetaData(const struct ECRS_MetaData * meta) {
537 GdkPixbufLoader * loader; 537 GdkPixbufLoader * loader;
538 size_t ts; 538 size_t ts;
539 unsigned char * thumb; 539 unsigned char * thumb;
540 540
541 thumb = NULL; 541 thumb = NULL;
542 ts = ECRS_getThumbnailFromMetaData(meta, 542 ts = ECRS_getThumbnailFromMetaData(meta,
543 &thumb); 543 &thumb);
@@ -560,7 +560,7 @@ GdkPixbuf * getThumbnailFromMetaData(const struct ECRS_MetaData * meta) {
560 return pixbuf; 560 return pixbuf;
561} 561}
562 562
563GtkWidget * 563GtkWidget *
564extractMainWidgetFromWindow(GladeXML * xml, 564extractMainWidgetFromWindow(GladeXML * xml,
565 const char * windowName) { 565 const char * windowName) {
566 GtkContainer * window; 566 GtkContainer * window;
diff --git a/src/plugins/fs/meta.h b/src/plugins/fs/meta.h
index 860734e8..f9650b6a 100644
--- a/src/plugins/fs/meta.h
+++ b/src/plugins/fs/meta.h
@@ -51,12 +51,12 @@ void handleMetaDataListUpdate(GladeXML * xml,
51 const char * valueInputLineName, 51 const char * valueInputLineName,
52 const char * metaDataListName); 52 const char * metaDataListName);
53 53
54struct ECRS_MetaData * 54struct ECRS_MetaData *
55getMetaDataFromList(GladeXML * xml, 55getMetaDataFromList(GladeXML * xml,
56 const char * name, 56 const char * name,
57 const char * preview); 57 const char * preview);
58 58
59struct ECRS_URI * 59struct ECRS_URI *
60getKeywordURIFromList(GladeXML * xml, 60getKeywordURIFromList(GladeXML * xml,
61 const char * name); 61 const char * name);
62 62
diff --git a/src/plugins/fs/namespace.c b/src/plugins/fs/namespace.c
index 57520198..6378ee53 100644
--- a/src/plugins/fs/namespace.c
+++ b/src/plugins/fs/namespace.c
@@ -227,7 +227,7 @@ static GtkWidget * makeNamespaceFrame(GtkWidget ** treeview,
227 col - 1), 227 col - 1),
228 TRUE); 228 TRUE);
229 229
230 230
231 UNREF(namespaceXML); 231 UNREF(namespaceXML);
232 DEBUG_END(); 232 DEBUG_END();
233 233
@@ -270,12 +270,12 @@ static void * updateView(void * cls) {
270 filename = STRDUP(_("no name given")); 270 filename = STRDUP(_("no name given"));
271 } else { 271 } else {
272 char * dotdot; 272 char * dotdot;
273 273
274 while (NULL != (dotdot = strstr(filename, ".."))) 274 while (NULL != (dotdot = strstr(filename, "..")))
275 dotdot[0] = dotdot[1] = '_'; 275 dotdot[0] = dotdot[1] = '_';
276 filename = validate_utf8(filename); 276 filename = validate_utf8(filename);
277 } 277 }
278 278
279 if (ECRS_isFileUri(fi->uri)) 279 if (ECRS_isFileUri(fi->uri))
280 size = ECRS_fileSize(fi->uri); 280 size = ECRS_fileSize(fi->uri);
281 else 281 else
@@ -308,7 +308,7 @@ static int updateViewSave(const ECRS_FileInfo * fi,
308 const HashCode512 * key, 308 const HashCode512 * key,
309 int isRoot, 309 int isRoot,
310 void * closure) { 310 void * closure) {
311 gtkSaveCall(&updateView, (void*) fi); 311 gtkSaveCall(&updateView, (void*) fi);
312 return OK; 312 return OK;
313} 313}
314 314
@@ -388,7 +388,7 @@ static int addNamespaceContentToModel(void * cls,
388 filename = STRDUP(_("no name given")); 388 filename = STRDUP(_("no name given"));
389 else { 389 else {
390 char *dotdot; 390 char *dotdot;
391 391
392 while (NULL != (dotdot = strstr(filename, ".."))) 392 while (NULL != (dotdot = strstr(filename, "..")))
393 dotdot[0] = dotdot[1] = '_'; 393 dotdot[0] = dotdot[1] = '_';
394 } 394 }
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index 402aa1c1..d2679f5a 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -58,12 +58,12 @@ static void updateSearchSummary(SearchList * searchContext) {
58 &iter, 58 &iter,
59 SEARCH_SUMMARY_RESULT_COUNT, searchContext->resultsReceived, 59 SEARCH_SUMMARY_RESULT_COUNT, searchContext->resultsReceived,
60 -1); 60 -1);
61 61
62 62
63 63
64 /* update tab title with the number of results */ 64 /* update tab title with the number of results */
65 new_title = 65 new_title =
66 g_strdup_printf("%s (%u)", 66 g_strdup_printf("%s (%u)",
67 searchContext->searchString, 67 searchContext->searchString,
68 searchContext->resultsReceived); 68 searchContext->resultsReceived);
69 label = GTK_LABEL(glade_xml_get_widget(searchContext->labelXML, 69 label = GTK_LABEL(glade_xml_get_widget(searchContext->labelXML,
@@ -89,7 +89,7 @@ void addEntryToSearchTree(SearchList * searchContext,
89 89
90 mime = getMimeTypeFromMetaData(info->meta); 90 mime = getMimeTypeFromMetaData(info->meta);
91 desc = getDescriptionFromMetaData(info->meta); 91 desc = getDescriptionFromMetaData(info->meta);
92 name = getFileNameFromMetaData(info->meta); 92 name = getFileNameFromMetaData(info->meta);
93 size = ECRS_isFileUri(info->uri) ? ECRS_fileSize(info->uri) : 0; 93 size = ECRS_isFileUri(info->uri) ? ECRS_fileSize(info->uri) : 0;
94 pixbuf = getThumbnailFromMetaData(info->meta); 94 pixbuf = getThumbnailFromMetaData(info->meta);
95 size_h = string_get_fancy_byte_size(size); 95 size_h = string_get_fancy_byte_size(size);
@@ -115,7 +115,7 @@ void addEntryToSearchTree(SearchList * searchContext,
115/** 115/**
116 * Add the given result to the model (search result 116 * Add the given result to the model (search result
117 * list). 117 * list).
118 * 118 *
119 * @param info the information to add to the model 119 * @param info the information to add to the model
120 * @param uri the search URI 120 * @param uri the search URI
121 * @param searchContext identifies the search page 121 * @param searchContext identifies the search page
@@ -129,7 +129,7 @@ void fs_search_result_received(SearchList * searchContext,
129 model = GTK_TREE_STORE(gtk_tree_view_get_model(searchContext->treeview)); 129 model = GTK_TREE_STORE(gtk_tree_view_get_model(searchContext->treeview));
130 gtk_tree_store_append(model, 130 gtk_tree_store_append(model,
131 &iter, 131 &iter,
132 NULL); 132 NULL);
133 addEntryToSearchTree(searchContext, 133 addEntryToSearchTree(searchContext,
134 NULL, 134 NULL,
135 info, 135 info,
@@ -142,7 +142,7 @@ void fs_search_result_received(SearchList * searchContext,
142 * FSUI event: a search was started; create the 142 * FSUI event: a search was started; create the
143 * tab and add an entry to the summary. 143 * tab and add an entry to the summary.
144 */ 144 */
145SearchList * 145SearchList *
146fs_search_started(struct FSUI_SearchList * fsui_list, 146fs_search_started(struct FSUI_SearchList * fsui_list,
147 const struct ECRS_URI * uri, 147 const struct ECRS_URI * uri,
148 unsigned int anonymityLevel, 148 unsigned int anonymityLevel,
@@ -186,7 +186,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
186 = STRDUP(dhead); 186 = STRDUP(dhead);
187 list->uri 187 list->uri
188 = ECRS_dupUri(uri); 188 = ECRS_dupUri(uri);
189 list->fsui_list 189 list->fsui_list
190 = fsui_list; 190 = fsui_list;
191 list->next 191 list->next
192 = search_head; 192 = search_head;
@@ -196,7 +196,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
196 "searchResultsFrame", 196 "searchResultsFrame",
197 PACKAGE_NAME); 197 PACKAGE_NAME);
198 connectGladeWithPlugins(list->searchXML); 198 connectGladeWithPlugins(list->searchXML);
199 list->searchpage 199 list->searchpage
200 = extractMainWidgetFromWindow(list->searchXML, 200 = extractMainWidgetFromWindow(list->searchXML,
201 "searchResultsFrame"); 201 "searchResultsFrame");
202 /* setup tree view and renderers */ 202 /* setup tree view and renderers */
@@ -263,7 +263,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
263 gtk_tree_view_column_set_clickable(column, TRUE); 263 gtk_tree_view_column_set_clickable(column, TRUE);
264 gtk_tree_view_column_set_reorderable(column, TRUE); 264 gtk_tree_view_column_set_reorderable(column, TRUE);
265 gtk_tree_view_column_set_sort_column_id(column, SEARCH_MIME); 265 gtk_tree_view_column_set_sort_column_id(column, SEARCH_MIME);
266 266
267 renderer = gtk_cell_renderer_text_new(); 267 renderer = gtk_cell_renderer_text_new();
268 col = gtk_tree_view_insert_column_with_attributes(list->treeview, 268 col = gtk_tree_view_insert_column_with_attributes(list->treeview,
269 -1, 269 -1,
@@ -313,14 +313,14 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
313 = gtk_tree_row_reference_new(GTK_TREE_MODEL(search_summary), 313 = gtk_tree_row_reference_new(GTK_TREE_MODEL(search_summary),
314 path); 314 path);
315 gtk_tree_path_free(path); 315 gtk_tree_path_free(path);
316 316
317 /* load label */ 317 /* load label */
318 list->labelXML 318 list->labelXML
319 = glade_xml_new(getGladeFileName(), 319 = glade_xml_new(getGladeFileName(),
320 "searchTabLabelWindow", 320 "searchTabLabelWindow",
321 PACKAGE_NAME); 321 PACKAGE_NAME);
322 connectGladeWithPlugins(list->labelXML); 322 connectGladeWithPlugins(list->labelXML);
323 list->tab_label 323 list->tab_label
324 = extractMainWidgetFromWindow(list->labelXML, 324 = extractMainWidgetFromWindow(list->labelXML,
325 "searchTabLabelWindow"); 325 "searchTabLabelWindow");
326 /* process existing results */ 326 /* process existing results */
@@ -330,11 +330,11 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
330 uri); 330 uri);
331 if (resultCount == 0) /* otherwise already done! */ 331 if (resultCount == 0) /* otherwise already done! */
332 updateSearchSummary(list); 332 updateSearchSummary(list);
333 333
334 /* insert new page into search notebook */ 334 /* insert new page into search notebook */
335 notebook 335 notebook
336 = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(), 336 = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(),
337 "downloadNotebook")); 337 "downloadNotebook"));
338 pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)); 338 pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
339 gtk_notebook_append_page(notebook, 339 gtk_notebook_append_page(notebook,
340 list->searchpage, 340 list->searchpage,
@@ -342,7 +342,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
342 gtk_notebook_set_current_page(notebook, 342 gtk_notebook_set_current_page(notebook,
343 pages); 343 pages);
344 gtk_widget_show(GTK_WIDGET(notebook)); /* may have been hidden! */ 344 gtk_widget_show(GTK_WIDGET(notebook)); /* may have been hidden! */
345 345
346 return list; 346 return list;
347} 347}
348 348
@@ -407,7 +407,7 @@ void fs_search_stopped(SearchList * list) {
407 search_head = search_head->next; 407 search_head = search_head->next;
408 } else { 408 } else {
409 prev = search_head; 409 prev = search_head;
410 while (prev->next != list) 410 while (prev->next != list)
411 prev = prev->next; 411 prev = prev->next;
412 prev->next = list->next; 412 prev->next = list->next;
413 } 413 }
@@ -435,13 +435,13 @@ void fs_search_stopped(SearchList * list) {
435 GE_BREAK(ectx, index != -1); 435 GE_BREAK(ectx, index != -1);
436 gtk_notebook_remove_page(notebook, 436 gtk_notebook_remove_page(notebook,
437 index); 437 index);
438 438
439 /* recursively free search model */ 439 /* recursively free search model */
440 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list->tree), 440 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list->tree),
441 &iter)) 441 &iter))
442 freeIterSubtree(GTK_TREE_MODEL(list->tree), 442 freeIterSubtree(GTK_TREE_MODEL(list->tree),
443 &iter); 443 &iter);
444 444
445 /* destroy entry in summary */ 445 /* destroy entry in summary */
446 path = gtk_tree_row_reference_get_path(list->summaryViewRowReference); 446 path = gtk_tree_row_reference_get_path(list->summaryViewRowReference);
447 gtk_tree_model_get_iter(GTK_TREE_MODEL(search_summary), 447 gtk_tree_model_get_iter(GTK_TREE_MODEL(search_summary),
@@ -611,7 +611,7 @@ static void * fsui_callback(void * cls) {
611 * search notebook. Note that "searchPage" can thus 611 * search notebook. Note that "searchPage" can thus
612 * either refer to the main page in the tab or to the 612 * either refer to the main page in the tab or to the
613 * main entry of the tab label. 613 * main entry of the tab label.
614 */ 614 */
615void on_closeSearchButton_clicked_fs(GtkWidget * searchPage, 615void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
616 GtkWidget * closeButton) { 616 GtkWidget * closeButton) {
617 SearchList * list; 617 SearchList * list;
diff --git a/src/plugins/fs/search.h b/src/plugins/fs/search.h
index a0e32f1b..4afc1496 100644
--- a/src/plugins/fs/search.h
+++ b/src/plugins/fs/search.h
@@ -58,7 +58,7 @@ void fs_search_result_received(SearchList * searchContext,
58 * 58 *
59 * @return internal search context 59 * @return internal search context
60 */ 60 */
61SearchList * 61SearchList *
62fs_search_started(struct FSUI_SearchList * list, 62fs_search_started(struct FSUI_SearchList * list,
63 const struct ECRS_URI * uri, 63 const struct ECRS_URI * uri,
64 unsigned int anonymityLevel, 64 unsigned int anonymityLevel,
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index 329e085d..8c037e5f 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -105,7 +105,7 @@ void fs_upload_stopped(UploadList * list) {
105 &iter, 105 &iter,
106 path); 106 path);
107 gtk_tree_path_free(path); 107 gtk_tree_path_free(path);
108 gtk_tree_row_reference_free(list->summaryViewRowReference); 108 gtk_tree_row_reference_free(list->summaryViewRowReference);
109 list->summaryViewRowReference = NULL; 109 list->summaryViewRowReference = NULL;
110 gtk_tree_store_remove(upload_summary, 110 gtk_tree_store_remove(upload_summary,
111 &iter); 111 &iter);
@@ -113,7 +113,7 @@ void fs_upload_stopped(UploadList * list) {
113 if (list->uri != NULL) { 113 if (list->uri != NULL) {
114 ECRS_freeUri(list->uri); 114 ECRS_freeUri(list->uri);
115 list->uri = NULL; 115 list->uri = NULL;
116 } 116 }
117 if (upload_head == list) 117 if (upload_head == list)
118 upload_head = list->next; 118 upload_head = list->next;
119 else { 119 else {
@@ -129,7 +129,7 @@ void fs_upload_stopped(UploadList * list) {
129 FREE(list); 129 FREE(list);
130} 130}
131 131
132UploadList * 132UploadList *
133fs_upload_started(struct FSUI_UploadList * fsui, 133fs_upload_started(struct FSUI_UploadList * fsui,
134 UploadList * parent, 134 UploadList * parent,
135 const char * filename, 135 const char * filename,
@@ -175,7 +175,7 @@ fs_upload_started(struct FSUI_UploadList * fsui,
175 UPLOAD_FILENAME, filename, 175 UPLOAD_FILENAME, filename,
176 UPLOAD_PROGRESS, progress, 176 UPLOAD_PROGRESS, progress,
177 UPLOAD_URISTRING, "", /* FIXME: set if URI != NULL! */ 177 UPLOAD_URISTRING, "", /* FIXME: set if URI != NULL! */
178 UPLOAD_INTERNAL, ret, 178 UPLOAD_INTERNAL, ret,
179 -1); 179 -1);
180 path = gtk_tree_model_get_path(GTK_TREE_MODEL(upload_summary), 180 path = gtk_tree_model_get_path(GTK_TREE_MODEL(upload_summary),
181 &iter); 181 &iter);
@@ -325,7 +325,7 @@ void on_fsinsertuploadbutton_clicked_fs(gpointer dummy,
325 325
326#ifndef MINGW 326#ifndef MINGW
327 327
328static char * 328static char *
329selectFile(const char * oldfilename) { 329selectFile(const char * oldfilename) {
330 GladeXML * uploadXML; 330 GladeXML * uploadXML;
331 GtkFileChooser * dialog; 331 GtkFileChooser * dialog;
@@ -341,10 +341,10 @@ selectFile(const char * oldfilename) {
341 gtk_file_chooser_set_filename(dialog, 341 gtk_file_chooser_set_filename(dialog,
342 oldfilename); 342 oldfilename);
343 if (getToggleButtonValue(getMainXML(), 343 if (getToggleButtonValue(getMainXML(),
344 "scopeRecursiveButton")) 344 "scopeRecursiveButton"))
345 gtk_file_chooser_set_action(dialog, 345 gtk_file_chooser_set_action(dialog,
346 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); 346 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
347 if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL) 347 if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_CANCEL)
348 ret = gtk_file_chooser_get_filename(dialog); 348 ret = gtk_file_chooser_get_filename(dialog);
349 else 349 else
350 ret = NULL; 350 ret = NULL;
@@ -355,7 +355,7 @@ selectFile(const char * oldfilename) {
355 355
356#else /* MINGW */ 356#else /* MINGW */
357 357
358static char * 358static char *
359selectFile(const char * oldfilename) { 359selectFile(const char * oldfilename) {
360 if (getToggleButtonValue(getMainXML(), 360 if (getToggleButtonValue(getMainXML(),
361 "scopeFileOnlyButton")) 361 "scopeFileOnlyButton"))
@@ -380,7 +380,7 @@ void on_mainFileSharingInsertBrowseButton_clicked_fs(GtkWidget * browseButton,
380 "uploadFilenameComboBoxEntry"); 380 "uploadFilenameComboBoxEntry");
381 entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(uploadLine))); 381 entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(uploadLine)));
382 oldfilename = gtk_entry_get_text(entry); 382 oldfilename = gtk_entry_get_text(entry);
383 if (oldfilename == NULL) 383 if (oldfilename == NULL)
384 oldfilename = getenv("PWD"); 384 oldfilename = getenv("PWD");
385 if (oldfilename == NULL) 385 if (oldfilename == NULL)
386 oldfilename = getenv("HOME"); 386 oldfilename = getenv("HOME");
@@ -390,7 +390,7 @@ void on_mainFileSharingInsertBrowseButton_clicked_fs(GtkWidget * browseButton,
390 filename = selectFile(ofn); 390 filename = selectFile(ofn);
391 FREE(ofn); 391 FREE(ofn);
392 if (NULL == filename) 392 if (NULL == filename)
393 return; 393 return;
394 gtk_entry_set_text(entry, 394 gtk_entry_set_text(entry,
395 filename); 395 filename);
396 model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(uploadLine))); 396 model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(uploadLine)));
@@ -401,7 +401,7 @@ void on_mainFileSharingInsertBrowseButton_clicked_fs(GtkWidget * browseButton,
401 0, 401 0,
402 filename, 402 filename,
403 -1); 403 -1);
404 free(filename); 404 free(filename);
405} 405}
406 406
407/* FIXME: handlers for clear and stop! */ 407/* FIXME: handlers for clear and stop! */
@@ -443,13 +443,13 @@ clearCompletedUploadCallback(GtkTreeModel * model,
443} 443}
444 444
445void on_clearCompletedUploadsButton_clicked_fs(void * unused, 445void on_clearCompletedUploadsButton_clicked_fs(void * unused,
446 GtkWidget * clearButton) { 446 GtkWidget * clearButton) {
447 gtk_tree_model_foreach(GTK_TREE_MODEL(upload_summary), 447 gtk_tree_model_foreach(GTK_TREE_MODEL(upload_summary),
448 &clearCompletedUploadCallback, 448 &clearCompletedUploadCallback,
449 NULL); 449 NULL);
450} 450}
451 451
452static void 452static void
453fsuiCallUploadCallback(GtkTreeModel * model, 453fsuiCallUploadCallback(GtkTreeModel * model,
454 GtkTreePath * path, 454 GtkTreePath * path,
455 GtkTreeIter * iter, 455 GtkTreeIter * iter,
diff --git a/src/plugins/fs/upload.h b/src/plugins/fs/upload.h
index 38db6ddb..69e2e49d 100644
--- a/src/plugins/fs/upload.h
+++ b/src/plugins/fs/upload.h
@@ -42,7 +42,7 @@ void fs_upload_stopped(UploadList * list);
42/** 42/**
43 * @param uri NULL if upload is not yet finished 43 * @param uri NULL if upload is not yet finished
44 */ 44 */
45UploadList * 45UploadList *
46fs_upload_started(struct FSUI_UploadList * fsui, 46fs_upload_started(struct FSUI_UploadList * fsui,
47 UploadList * parent, 47 UploadList * parent,
48 const char * filename, 48 const char * filename,
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c
index 9be3bba7..ffb99733 100644
--- a/src/plugins/stats/functions.c
+++ b/src/plugins/stats/functions.c
@@ -333,7 +333,7 @@ static int getEffectivenessStats(const void * closure,
333 long long lsuccess; 333 long long lsuccess;
334 long long llocal; 334 long long llocal;
335 cron_t now; 335 cron_t now;
336 336
337 now = get_time(); 337 now = get_time();
338 if (now < last + 2 * cronMINUTES) { 338 if (now < last + 2 * cronMINUTES) {
339 data[0][0] = lastdata; 339 data[0][0] = lastdata;
@@ -364,8 +364,8 @@ static int getEffectivenessStats(const void * closure,
364 data[0][1] = 0.0; 364 data[0][1] = 0.0;
365 return OK; 365 return OK;
366 } 366 }
367 if (total == 0) 367 if (total == 0)
368 return OK; 368 return OK;
369 success -= lsuccess; 369 success -= lsuccess;
370 local -= llocal; 370 local -= llocal;
371 if (success <= local) 371 if (success <= local)
diff --git a/src/plugins/stats/statistics.c b/src/plugins/stats/statistics.c
index a93c9bff..e9375e06 100644
--- a/src/plugins/stats/statistics.c
+++ b/src/plugins/stats/statistics.c
@@ -117,8 +117,8 @@ static void load_graph_draw(LoadGraph *g) {
117 g->disp->allocation.height); 117 g->disp->allocation.height);
118 118
119 max = 0.26; /* force showing at least the 25% line */ 119 max = 0.26; /* force showing at least the 25% line */
120 for (i = 0; i < g->num_points - 1; i++) 120 for (i = 0; i < g->num_points - 1; i++)
121 for (j=0;j<g->count;j++) 121 for (j=0;j<g->count;j++)
122 if (g->data[i][j] > max) 122 if (g->data[i][j] > max)
123 max = g->data[i][j]; 123 max = g->data[i][j];
124 max = max * 1.01; /* leave top 1% free */ 124 max = max * 1.01; /* leave top 1% free */
@@ -130,7 +130,7 @@ static void load_graph_draw(LoadGraph *g) {
130 for (i = 1; i < 5; i++) { 130 for (i = 1; i < 5; i++) {
131 gint y1 = g->draw_height + 1 - i * dely; 131 gint y1 = g->draw_height + 1 - i * dely;
132 if ( (dely < 30) && (i != 4) ) 132 if ( (dely < 30) && (i != 4) )
133 continue; /* only print additional 133 continue; /* only print additional
134 lines if there is enough space! */ 134 lines if there is enough space! */
135 if (y1 > 0) { 135 if (y1 > 0) {
136 const gchar * label[] = { 136 const gchar * label[] = {