aboutsummaryrefslogtreecommitdiff
path: root/src/common/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/helper.c')
-rw-r--r--src/common/helper.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/common/helper.c b/src/common/helper.c
index 0f3751d7..90c817b5 100644
--- a/src/common/helper.c
+++ b/src/common/helper.c
@@ -286,7 +286,7 @@ static void connector(const gchar *handler_name,
286 if ( (module == NULL) || 286 if ( (module == NULL) ||
287 (TRUE != g_module_symbol(module, 287 (TRUE != g_module_symbol(module,
288 handler_name, 288 handler_name,
289 &method)) ) { 289 &method)) ) {
290 GE_LOG(ectx, 290 GE_LOG(ectx,
291 GE_WARNING | GE_DEVELOPER | GE_IMMEDIATE, 291 GE_WARNING | GE_DEVELOPER | GE_IMMEDIATE,
292 _("Failed to find handler for `%s'\n"), 292 _("Failed to find handler for `%s'\n"),
@@ -320,8 +320,8 @@ static void loadPlugin(const char * name) {
320 lib = os_plugin_load(ectx, 320 lib = os_plugin_load(ectx,
321 "libgnunetgtkmodule_", 321 "libgnunetgtkmodule_",
322 name); 322 name);
323 if (lib == NULL) 323 if (lib == NULL)
324 return; 324 return;
325 p = MALLOC(sizeof(Plugin)); 325 p = MALLOC(sizeof(Plugin));
326 p->name = STRDUP(name); 326 p->name = STRDUP(name);
327 p->next = plugin; 327 p->next = plugin;
@@ -357,8 +357,8 @@ static void loadPlugins(const char * names) {
357 *next = '\0'; /* add 0-termination for pos */ 357 *next = '\0'; /* add 0-termination for pos */
358 next++; 358 next++;
359 } 359 }
360 if (strlen(pos) > 0) 360 if (strlen(pos) > 0)
361 loadPlugin(pos); 361 loadPlugin(pos);
362 } while (next != NULL); 362 } while (next != NULL);
363 FREE(dup); 363 FREE(dup);
364} 364}
@@ -404,7 +404,7 @@ void initGNUnetGTKCommon(struct GE_Context * e,
404 gladeFile = STRDUP(filename); 404 gladeFile = STRDUP(filename);
405#endif 405#endif
406 FREE(filename); 406 FREE(filename);
407 407
408 mainXML = glade_xml_new(gladeFile, 408 mainXML = glade_xml_new(gladeFile,
409 "mainWindow", 409 "mainWindow",
410 PACKAGE_NAME); 410 PACKAGE_NAME);
@@ -540,30 +540,30 @@ void * run_with_save_calls(PThreadMain cb,
540 * 540 *
541 */ 541 */
542void gnunetgtk_notify(int type, 542void gnunetgtk_notify(int type,
543 const char *message, 543 const char *message,
544 ...) { 544 ...) {
545#ifdef WITH_LIBNOTIFY 545#ifdef WITH_LIBNOTIFY
546 static int once; 546 static int once;
547 char * msg; 547 char * msg;
548 size_t size; 548 size_t size;
549 va_list arg; 549 va_list arg;
550 GtkWidget * root; 550 GtkWidget * root;
551 NotifyNotification *libnotify; 551 NotifyNotification *libnotify;
552 NotifyUrgency libnotify_urgency = NOTIFY_URGENCY_NORMAL; 552 NotifyUrgency libnotify_urgency = NOTIFY_URGENCY_NORMAL;
553 long libnotify_expire_timeout = NOTIFY_EXPIRES_DEFAULT; 553 long libnotify_expire_timeout = NOTIFY_EXPIRES_DEFAULT;
554 554
555 if (! notify_is_initted()){ 555 if (! notify_is_initted()){
556 if (once == 1) 556 if (once == 1)
557 return; 557 return;
558 if (! notify_init ("gnunet-gtk")) { 558 if (! notify_init ("gnunet-gtk")) {
559 once = 1; 559 once = 1;
560 GE_LOG(ectx, 560 GE_LOG(ectx,
561 GE_WARNING | GE_BULK | GE_USER | GE_ADMIN, 561 GE_WARNING | GE_BULK | GE_USER | GE_ADMIN,
562 _("Could not initialize libnotify\n")); 562 _("Could not initialize libnotify\n"));
563 return; 563 return;
564 } 564 }
565 } 565 }
566 566
567 root = glade_xml_get_widget(getMainXML(),"mainWindow"); 567 root = glade_xml_get_widget(getMainXML(),"mainWindow");
568 if (gtk_window_is_active(GTK_WINDOW(root)) == FALSE) { 568 if (gtk_window_is_active(GTK_WINDOW(root)) == FALSE) {
569 if (type == NOTIFY_LOW) 569 if (type == NOTIFY_LOW)
@@ -611,7 +611,7 @@ char * validate_utf8(char * msg) {
611 end = NULL; 611 end = NULL;
612 if (TRUE == g_utf8_validate(msg, 612 if (TRUE == g_utf8_validate(msg,
613 -1, 613 -1,
614 &end)) 614 &end))
615 return msg; 615 return msg;
616 /* hope that it is ISO8859-1 */ 616 /* hope that it is ISO8859-1 */
617 ret = g_convert_with_fallback(msg, 617 ret = g_convert_with_fallback(msg,
@@ -707,17 +707,17 @@ void ggc_tree_selection_selected_foreach(GtkTreeSelection *selection,
707 707
708 selected = gtk_tree_selection_get_selected_rows(selection, 708 selected = gtk_tree_selection_get_selected_rows(selection,
709 &model); 709 &model);
710 710
711 i = g_list_length(selected); 711 i = g_list_length(selected);
712 size = 0; 712 size = 0;
713 refs = NULL; 713 refs = NULL;
714 GROW(refs, 714 GROW(refs,
715 size, 715 size,
716 i); 716 i);
717 for (i=0;i<size;i++) 717 for (i=0;i<size;i++)
718 refs[i] = gtk_tree_row_reference_new(model, 718 refs[i] = gtk_tree_row_reference_new(model,
719 g_list_nth_data(selected, i)); 719 g_list_nth_data(selected, i));
720 g_list_foreach(selected, 720 g_list_foreach(selected,
721 (GFunc) &gtk_tree_path_free, 721 (GFunc) &gtk_tree_path_free,
722 NULL); 722 NULL);
723 g_list_free(selected); 723 g_list_free(selected);
@@ -726,12 +726,12 @@ void ggc_tree_selection_selected_foreach(GtkTreeSelection *selection,
726 gtk_tree_row_reference_free(refs[i]); 726 gtk_tree_row_reference_free(refs[i]);
727 if (TRUE == gtk_tree_model_get_iter(model, 727 if (TRUE == gtk_tree_model_get_iter(model,
728 &iter, 728 &iter,
729 path)) 729 path))
730 func(model, 730 func(model,
731 path, 731 path,
732 &iter, 732 &iter,
733 data); 733 data);
734 gtk_tree_path_free(path); 734 gtk_tree_path_free(path);
735 } 735 }
736 GROW(refs, 736 GROW(refs,
737 size, 737 size,