[gnome-settings-daemon/gnome-3-20] media-keys: Fix "format not a string literal" error



commit 77a8c304a8ddd0386969550efa5e956dafd61d55
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 7 15:28:48 2016 +0200

    media-keys: Fix "format not a string literal" error
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764729

 plugins/media-keys/gsd-screenshot-utils.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/plugins/media-keys/gsd-screenshot-utils.c b/plugins/media-keys/gsd-screenshot-utils.c
index 242115f..45f9109 100644
--- a/plugins/media-keys/gsd-screenshot-utils.c
+++ b/plugins/media-keys/gsd-screenshot-utils.c
@@ -77,13 +77,9 @@ screenshot_context_free (ScreenshotContext *ctx)
 }
 
 static void
-screenshot_context_error (ScreenshotContext *ctx,
-                          GError *error,
-                          const gchar *warning_format)
+screenshot_play_error_sound_effect (void)
 {
   screenshot_play_sound_effect ("dialog-error", _("Unable to capture a screenshot"));
-  g_warning (warning_format, error->message);
-  g_error_free (error);
 }
 
 static void
@@ -108,7 +104,9 @@ screenshot_save_to_clipboard (ScreenshotContext *ctx)
   screenshot = gdk_pixbuf_new_from_file (ctx->used_filename, &error);
   if (error != NULL)
     {
-      screenshot_context_error (ctx, error, "Failed to save a screenshot to clipboard: %s\n");
+      screenshot_play_error_sound_effect ();
+      g_warning ("Failed to save a screenshot to clipboard: %s\n", error->message);
+      g_error_free (error);
       return;
     }
 
@@ -136,7 +134,9 @@ bus_call_ready_cb (GObject *source,
 
   if (error != NULL)
     {
-      screenshot_context_error (ctx, error, "Failed to save a screenshot: %s\n");
+      screenshot_play_error_sound_effect ();
+      g_warning ("Failed to save a screenshot: %s\n", error->message);
+      g_error_free (error);
       screenshot_context_free (ctx);
 
       return;
@@ -248,7 +248,9 @@ bus_connection_ready_cb (GObject *source,
 
   if (error != NULL)
     {
-      screenshot_context_error (ctx, error, "Failed to save a screenshot: %s\n");
+      screenshot_play_error_sound_effect ();
+      g_warning ("Failed to save a screenshot: %s\n", error->message);
+      g_error_free (error);
       screenshot_context_free (ctx);
 
       return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]