[gnome-utils] Fix warnings of format_secondary_text in the right way
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-utils] Fix warnings of format_secondary_text in the right way
- Date: Mon, 29 Jun 2009 09:58:13 +0000 (UTC)
commit e717bc47fcdc7ff52179f91036cc5f9dbd85ffe6
Author: Paolo Borelli <porelli gnome org>
Date: Mon Jun 29 11:57:51 2009 +0200
Fix warnings of format_secondary_text in the right way
baobab/src/baobab-remote-connect-dialog.c | 3 +--
baobab/src/baobab-utils.c | 19 +++++++++++++------
baobab/src/baobab-utils.h | 4 ++--
3 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/baobab/src/baobab-remote-connect-dialog.c b/baobab/src/baobab-remote-connect-dialog.c
index 6c2385e..2cb467a 100644
--- a/baobab/src/baobab-remote-connect-dialog.c
+++ b/baobab/src/baobab-remote-connect-dialog.c
@@ -85,7 +85,7 @@ display_error_dialog (GError *error,
error_message, NULL);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg),
- error->message, NULL);
+ "%s", error->message);
g_free (error_message);
@@ -101,7 +101,6 @@ mount_enclosing_ready_cb (GFile *location,
gboolean success;
GError *error = NULL;
-
success = g_file_mount_enclosing_volume_finish (location,
res, &error);
diff --git a/baobab/src/baobab-utils.c b/baobab/src/baobab-utils.c
index a05ecda..7624f8f 100644
--- a/baobab/src/baobab-utils.c
+++ b/baobab/src/baobab-utils.c
@@ -243,7 +243,10 @@ show_bars (GtkTreeModel *mdl,
}
void
-message (gchar *primary_msg, gchar *secondary_msg, GtkMessageType type, GtkWidget *parent)
+message (const gchar *primary_msg,
+ const gchar *secondary_msg,
+ GtkMessageType type,
+ GtkWidget *parent)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
@@ -251,13 +254,17 @@ message (gchar *primary_msg, gchar *secondary_msg, GtkMessageType type, GtkWidge
type,
GTK_BUTTONS_OK, "%s", primary_msg);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- secondary_msg, NULL);
+ "%s", secondary_msg);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
gint
-messageyesno (gchar *primary_msg, gchar *secondary_msg, GtkMessageType type, gchar *ok_button, GtkWidget *parent)
+messageyesno (const gchar *primary_msg,
+ const gchar *secondary_msg,
+ GtkMessageType type,
+ gchar *ok_button,
+ GtkWidget *parent)
{
GtkWidget *dialog;
GtkWidget *button;
@@ -269,8 +276,8 @@ messageyesno (gchar *primary_msg, gchar *secondary_msg, GtkMessageType type, gch
GTK_BUTTONS_CANCEL,
"%s", primary_msg);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- secondary_msg, NULL);
-
+ "%s", secondary_msg);
+
button = gtk_button_new_with_mnemonic (ok_button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
@@ -569,7 +576,7 @@ baobab_help_display (GtkWindow *parent,
_("There was an error displaying help."));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- error->message, NULL);
+ "%s", error->message);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy), NULL);
diff --git a/baobab/src/baobab-utils.h b/baobab/src/baobab-utils.h
index d41b77d..c5af605 100644
--- a/baobab/src/baobab-utils.h
+++ b/baobab/src/baobab-utils.h
@@ -33,8 +33,8 @@ gboolean show_bars (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
-void message (gchar *, gchar *, GtkMessageType, GtkWidget *);
-gint messageyesno (gchar *primary_msg, gchar *secondary_msg, GtkMessageType type, gchar * ok_button, GtkWidget *parent);
+void message (const gchar *primary_msg, const gchar *secondary_msg, GtkMessageType type, GtkWidget *parent);
+gint messageyesno (const gchar *primary_msg, const gchar *secondary_msg, GtkMessageType type, gchar * ok_button, GtkWidget *parent);
gboolean baobab_check_dir (GFile *);
void popupmenu_list (GtkTreePath *path, GdkEventButton *event, gboolean can_trash);
void set_label_scan (baobab_fs *);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]