diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-26 20:03:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-26 20:03:46 +0000 |
commit | 90513c8a7f4cd29e8db2e51191fff23caf6b6aed (patch) | |
tree | 4c72caa3037ea2cd34b5130507c1291f0e54ad95 | |
parent | c13d9e4bcd102933ffa97c4f9d687095d7e3d0b1 (diff) | |
download | gnunet-gtk-90513c8a7f4cd29e8db2e51191fff23caf6b6aed.tar.gz gnunet-gtk-90513c8a7f4cd29e8db2e51191fff23caf6b6aed.zip |
-remove unnecessary bad early NULLing
-rw-r--r-- | src/lib/about.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/about.c b/src/lib/about.c index 2d643033..041e5c78 100644 --- a/src/lib/about.c +++ b/src/lib/about.c | |||
@@ -26,20 +26,24 @@ | |||
26 | */ | 26 | */ |
27 | #include "gnunet_gtk.h" | 27 | #include "gnunet_gtk.h" |
28 | 28 | ||
29 | |||
29 | static void | 30 | static void |
30 | destroy_about_dialog (GtkBuilder *builder) | 31 | destroy_about_dialog (GtkBuilder *builder) |
31 | { | 32 | { |
32 | GtkWidget *ad; | 33 | GtkWidget *ad; |
34 | |||
33 | ad = GTK_WIDGET (gtk_builder_get_object (builder, "about_window")); | 35 | ad = GTK_WIDGET (gtk_builder_get_object (builder, "about_window")); |
34 | gtk_widget_destroy (ad); | 36 | gtk_widget_destroy (ad); |
35 | g_object_unref (G_OBJECT (builder)); | 37 | g_object_unref (G_OBJECT (builder)); |
36 | } | 38 | } |
37 | 39 | ||
40 | |||
38 | static void | 41 | static void |
39 | about_window_show_exclusively (GtkBuilder *builder, gchar *name) | 42 | about_window_show_exclusively (GtkBuilder *builder, gchar *name) |
40 | { | 43 | { |
41 | GtkWidget *about_credits_notebook; | 44 | GtkWidget *about_credits_notebook; |
42 | GtkWidget *about_license_scroller; | 45 | GtkWidget *about_license_scroller; |
46 | |||
43 | about_credits_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "about_credits_notebook")); | 47 | about_credits_notebook = GTK_WIDGET (gtk_builder_get_object (builder, "about_credits_notebook")); |
44 | about_license_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_scroller")); | 48 | about_license_scroller = GTK_WIDGET (gtk_builder_get_object (builder, "about_license_scroller")); |
45 | if (name == NULL) | 49 | if (name == NULL) |
@@ -59,6 +63,7 @@ about_window_show_exclusively (GtkBuilder *builder, gchar *name) | |||
59 | } | 63 | } |
60 | } | 64 | } |
61 | 65 | ||
66 | |||
62 | G_MODULE_EXPORT void | 67 | G_MODULE_EXPORT void |
63 | GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data) | 68 | GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data) |
64 | { | 69 | { |
@@ -66,14 +71,15 @@ GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data) | |||
66 | GtkTextBuffer *license_contents; | 71 | GtkTextBuffer *license_contents; |
67 | gchar *license = NULL; | 72 | gchar *license = NULL; |
68 | const char *path; | 73 | const char *path; |
69 | char *license_path = NULL; | 74 | char *license_path; |
75 | |||
70 | license_contents = GTK_TEXT_BUFFER (gtk_builder_get_object (builder, "license_contents")); | 76 | license_contents = GTK_TEXT_BUFFER (gtk_builder_get_object (builder, "license_contents")); |
71 | path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DOCDIR); | 77 | path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DOCDIR); |
72 | if (path != NULL) | 78 | if (path != NULL) |
73 | GNUNET_asprintf (&license_path, "%s%s", path, "COPYING"); | 79 | GNUNET_asprintf (&license_path, "%s%s", path, "COPYING"); |
74 | else | 80 | else |
75 | license_path = GNUNET_strdup ("COPYING"); | 81 | license_path = GNUNET_strdup ("COPYING"); |
76 | if (g_file_get_contents (license_path, &license, NULL, NULL) && license != NULL) | 82 | if (g_file_get_contents (license_path, &license, NULL, NULL) && (license != NULL)) |
77 | { | 83 | { |
78 | gtk_text_buffer_set_text (license_contents, license, -1); | 84 | gtk_text_buffer_set_text (license_contents, license, -1); |
79 | g_free (license); | 85 | g_free (license); |
@@ -81,6 +87,7 @@ GNUNET_GTK_about_window_realized (GtkWidget *widget, gpointer user_data) | |||
81 | GNUNET_free_non_null (license_path); | 87 | GNUNET_free_non_null (license_path); |
82 | } | 88 | } |
83 | 89 | ||
90 | |||
84 | G_MODULE_EXPORT void | 91 | G_MODULE_EXPORT void |
85 | GNUNET_GTK_about_close_button_clicked (GtkButton *widget, gpointer user_data) | 92 | GNUNET_GTK_about_close_button_clicked (GtkButton *widget, gpointer user_data) |
86 | { | 93 | { |
@@ -88,6 +95,7 @@ GNUNET_GTK_about_close_button_clicked (GtkButton *widget, gpointer user_data) | |||
88 | destroy_about_dialog (builder); | 95 | destroy_about_dialog (builder); |
89 | } | 96 | } |
90 | 97 | ||
98 | |||
91 | G_MODULE_EXPORT gboolean | 99 | G_MODULE_EXPORT gboolean |
92 | GNUNET_GTK_about_window_got_delete_event (GtkWidget *widget, GdkEvent *event, | 100 | GNUNET_GTK_about_window_got_delete_event (GtkWidget *widget, GdkEvent *event, |
93 | gpointer user_data) | 101 | gpointer user_data) |
@@ -97,6 +105,7 @@ GNUNET_GTK_about_window_got_delete_event (GtkWidget *widget, GdkEvent *event, | |||
97 | return FALSE; | 105 | return FALSE; |
98 | } | 106 | } |
99 | 107 | ||
108 | |||
100 | G_MODULE_EXPORT void | 109 | G_MODULE_EXPORT void |
101 | GNUNET_GTK_about_credits_button_clicked (GtkButton *widget, gpointer user_data) | 110 | GNUNET_GTK_about_credits_button_clicked (GtkButton *widget, gpointer user_data) |
102 | { | 111 | { |
@@ -111,6 +120,7 @@ GNUNET_GTK_about_license_button_clicked (GtkButton *widget, gpointer user_data) | |||
111 | about_window_show_exclusively (builder, "about_license_scroller"); | 120 | about_window_show_exclusively (builder, "about_license_scroller"); |
112 | } | 121 | } |
113 | 122 | ||
123 | |||
114 | /** | 124 | /** |
115 | * This displays an about dialog. | 125 | * This displays an about dialog. |
116 | * | 126 | * |