[tracker] Prevent build failure with -Wformat-nonliteral
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Prevent build failure with -Wformat-nonliteral
- Date: Fri, 18 Dec 2009 09:25:17 +0000 (UTC)
commit 9889de4e4df4a3e34552f7712e170d2dafd19983
Author: Debarshi Ray <debarshir src gnome org>
Date: Thu Dec 10 01:29:51 2009 +0200
Prevent build failure with -Wformat-nonliteral
src/plugins/nautilus/tracker-tags-extension.c | 13 ++++++----
src/plugins/nautilus/tracker-tags-view.c | 33 ++++++++++++++++---------
2 files changed, 29 insertions(+), 17 deletions(-)
---
diff --git a/src/plugins/nautilus/tracker-tags-extension.c b/src/plugins/nautilus/tracker-tags-extension.c
index 2a09a9d..778b2a7 100644
--- a/src/plugins/nautilus/tracker-tags-extension.c
+++ b/src/plugins/nautilus/tracker-tags-extension.c
@@ -70,11 +70,14 @@ tracker_tags_extension_update_finished (GError *error, gpointer user_data)
{
if (NULL != error)
{
- GtkWidget *error_dialog;
-
- error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, error->message);
- g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_dialog_run (GTK_DIALOG (error_dialog));
+ if (NULL != error->message)
+ {
+ GtkWidget *error_dialog;
+
+ error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", error->message);
+ g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (error_dialog));
+ }
g_error_free (error);
}
}
diff --git a/src/plugins/nautilus/tracker-tags-view.c b/src/plugins/nautilus/tracker-tags-view.c
index 4a5ce7d..d955564 100644
--- a/src/plugins/nautilus/tracker-tags-view.c
+++ b/src/plugins/nautilus/tracker-tags-view.c
@@ -174,11 +174,14 @@ tracker_tags_view_query_each_tag_finished (GPtrArray *result, GError *error, gpo
if (NULL != error)
{
- GtkWidget *error_dialog;
+ if (NULL != error->message)
+ {
+ GtkWidget *error_dialog;
- error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, error->message);
- g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_dialog_run (GTK_DIALOG (error_dialog));
+ error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", error->message);
+ g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (error_dialog));
+ }
g_error_free (error);
goto end;
}
@@ -240,11 +243,14 @@ tracker_tags_view_query_all_tags_finished (GPtrArray *result, GError *error, gpo
if (NULL != error)
{
- GtkWidget *error_dialog;
+ if (NULL != error->message)
+ {
+ GtkWidget *error_dialog;
- error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, error->message);
- g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_dialog_run (GTK_DIALOG (error_dialog));
+ error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", error->message);
+ g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (error_dialog));
+ }
g_error_free (error);
return;
}
@@ -277,11 +283,14 @@ tracker_tags_view_update_finished (GError *error, gpointer user_data)
{
if (NULL != error)
{
- GtkWidget *error_dialog;
+ if (NULL != error->message)
+ {
+ GtkWidget *error_dialog;
- error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, error->message);
- g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_dialog_run (GTK_DIALOG (error_dialog));
+ error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_NO_SEPARATOR, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", error->message);
+ g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ gtk_dialog_run (GTK_DIALOG (error_dialog));
+ }
g_error_free (error);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]