[Xfce4-commits] <libxfce4ui:master> Drop some useless comments.
Nick Schermer
noreply at xfce.org
Mon Feb 15 19:40:01 CET 2010
Updating branch refs/heads/master
to 1d978e8fbdc225e455c4dffc843f3fe0f2024d04 (commit)
from 77c783a4c7e0b4ff438768467ee2b720b0c070be (commit)
commit 1d978e8fbdc225e455c4dffc843f3fe0f2024d04
Author: Nick Schermer <nick at xfce.org>
Date: Mon Feb 15 19:37:19 2010 +0100
Drop some useless comments.
libxfce4ui/xfce-dialogs.c | 23 -----------------------
libxfce4ui/xfce-gdk-extensions.c | 5 +----
libxfce4ui/xfce-gtk-extensions.c | 8 --------
3 files changed, 1 insertions(+), 35 deletions(-)
diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c
index e565ddc..c683c49 100644
--- a/libxfce4ui/xfce-dialogs.c
+++ b/libxfce4ui/xfce-dialogs.c
@@ -62,17 +62,14 @@ xfce_dialog_show_info (GtkWindow *parent,
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
- /* create primary text */
va_start (args, primary_format);
primary_text = g_strdup_vprintf (primary_format, args);
va_end (args);
- /* run dialog */
xfce_message_dialog (parent, _("Information"), GTK_STOCK_DIALOG_INFO,
primary_text, secondary_text,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
- /* cleanup */
g_free (primary_text);
}
@@ -98,17 +95,14 @@ xfce_dialog_show_warning (GtkWindow *parent,
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
- /* create primary text */
va_start (args, primary_format);
primary_text = g_strdup_vprintf (primary_format, args);
va_end (args);
- /* run dialog */
xfce_message_dialog (parent, _("Warning"), GTK_STOCK_DIALOG_WARNING,
primary_text, secondary_text,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
- /* cleanup */
g_free (primary_text);
}
@@ -135,17 +129,14 @@ xfce_dialog_show_error (GtkWindow *parent,
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
- /* create primary text */
va_start (args, primary_format);
primary_text = g_strdup_vprintf (primary_format, args);
va_end (args);
- /* run dialog */
xfce_message_dialog (parent, _("Error"), GTK_STOCK_DIALOG_ERROR,
primary_text, error ? error->message : NULL,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
- /* cleanup */
g_free (primary_text);
}
@@ -183,7 +174,6 @@ xfce_dialog_confirm (GtkWindow *parent,
g_return_val_if_fail (stock_id != NULL || confirm_label != NULL, FALSE);
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), FALSE);
- /* create primary text */
va_start (args, primary_format);
primary_text = g_strdup_vprintf (primary_format, args);
va_end (args);
@@ -194,7 +184,6 @@ xfce_dialog_confirm (GtkWindow *parent,
else
no_stock_id = GTK_STOCK_CANCEL;
- /* run dialog */
response_id = xfce_message_dialog (parent, _("Question"),
GTK_STOCK_DIALOG_QUESTION,
primary_text, secondary_text,
@@ -202,7 +191,6 @@ xfce_dialog_confirm (GtkWindow *parent,
XFCE_BUTTON_TYPE_MIXED, stock_id,
confirm_label, GTK_RESPONSE_YES, NULL);
- /* cleanup */
g_free (primary_text);
return (response_id == GTK_RESPONSE_YES);
@@ -247,7 +235,6 @@ xfce_message_dialog_new_valist (GtkWindow *parent,
g_return_val_if_fail (primary_text != NULL || secondary_text != NULL, NULL);
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
- /* create the dialog */
if (G_LIKELY (primary_text != NULL))
{
/* create dialog with large bold text */
@@ -257,7 +244,6 @@ xfce_message_dialog_new_valist (GtkWindow *parent,
"<span weight='bold' size='large'>%s</span>",
primary_text);
- /* set secondary text */
if (secondary_text != NULL)
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", secondary_text);
}
@@ -270,7 +256,6 @@ xfce_message_dialog_new_valist (GtkWindow *parent,
"%s", secondary_text);
}
- /* set title */
if (title != NULL)
gtk_window_set_title (GTK_WINDOW (dialog), title);
@@ -318,7 +303,6 @@ xfce_message_dialog_new_valist (GtkWindow *parent,
else
scaled = NULL;
- /* create image */
image = gtk_image_new_from_pixbuf (scaled ? scaled : pixbuf);
/* release scaled image */
@@ -438,7 +422,6 @@ xfce_message_dialog_new (GtkWindow *parent,
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
- /* create dialog */
va_start (args, first_button_text);
dialog = xfce_message_dialog_new_valist (parent, title, stock_id, primary_text,
secondary_text, first_button_text, args);
@@ -481,19 +464,13 @@ xfce_message_dialog (GtkWindow *parent,
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), 0);
- /* create dialog */
va_start (args, first_button_text);
dialog = xfce_message_dialog_new_valist (parent, title, stock_id, primary_text,
secondary_text, first_button_text, args);
va_end (args);
- /* run the dialog */
response_id = gtk_dialog_run (GTK_DIALOG (dialog));
- /* hide */
- gtk_widget_hide (dialog);
-
- /* destroy */
gtk_widget_destroy (dialog);
return response_id;
diff --git a/libxfce4ui/xfce-gdk-extensions.c b/libxfce4ui/xfce-gdk-extensions.c
index 45e9723..c824eba 100644
--- a/libxfce4ui/xfce-gdk-extensions.c
+++ b/libxfce4ui/xfce-gdk-extensions.c
@@ -84,15 +84,12 @@ xfce_gdk_screen_get_active (gint *monitor_return)
}
}
- /* fallback to the default screen */
+ /* nothing found, fallback to default screen */
screen = gdk_screen_get_default ();
-
- /* no monitor was found */
if (monitor_return != NULL)
*monitor_return = 0;
out:
- /* release the displays */
g_slist_free (displays);
return screen;
diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index 54110b0..977fa75 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -61,7 +61,6 @@ xfce_gtk_button_new_mixed (const gchar *stock_id,
if (label != NULL)
{
- /* create button */
button = gtk_button_new_with_mnemonic (label);
if (stock_id != NULL)
@@ -108,7 +107,6 @@ xfce_gtk_frame_box_new (const gchar *label,
g_return_val_if_fail (container_return != NULL, NULL);
- /* create frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_frame_set_label_align (GTK_FRAME (frame), 0.0, 1.0);
@@ -125,13 +123,11 @@ xfce_gtk_frame_box_new (const gchar *label,
gtk_widget_show (frame_label);
}
- /* create the container */
container = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (container), PADDING, PADDING, PADDING * 3, PADDING);
gtk_container_add (GTK_CONTAINER (frame), container);
gtk_widget_show (container);
- /* return container */
if (G_LIKELY (container_return != NULL))
*container_return = container;
@@ -157,10 +153,7 @@ xfce_gtk_frame_box_new_with_content (const gchar *label,
GtkWidget *frame;
GtkWidget *container;
- /* create frame */
frame = xfce_gtk_frame_box_new (label, &container);
-
- /* add content */
gtk_container_add (GTK_CONTAINER (container), content);
return frame;
@@ -191,7 +184,6 @@ xfce_gtk_window_center_on_active_screen (GtkWindow *window)
/* get the screen with the pointer */
screen = xfce_gdk_screen_get_active (NULL);
- /* set the window screen */
gtk_window_set_screen (window, screen);
/* gtk+ handles the centering of the window properly after resize */
More information about the Xfce4-commits
mailing list