gedit r6498 - in trunk: . bindings/python data gedit plugins/changecase plugins/docinfo plugins/filebrowser plugins/sort plugins/time



Author: pborelli
Date: Sun Sep  7 13:50:57 2008
New Revision: 6498
URL: http://svn.gnome.org/viewvc/gedit?rev=6498&view=rev

Log:
2008-09-07  Paolo Borelli  <pborelli katamail com>

	* plugins/docinfo/gedit-docinfo-plugin.c:
	* plugins/changecase/gedit-changecase-plugin.c:
	* plugins/filebrowser/gedit-file-browser-plugin.c:
	* plugins/sort/gedit-sort-plugin.c:
	* plugins/time/gedit-time-plugin.c:
	* gedit/gedit-local-document-saver.c:
	* gedit/gedit-module.c:
	* gedit/gedit-utils.c:
	* gedit/gedit-app.c:
	* gedit/gedit-mmap-document-loader.c:
	* gedit/gedit-help.c:
	* gedit/gedit-commands-file.c:
	* gedit/gedit-plugins-engine.c:
	* gedit/gedit-document-saver.c:
	* bindings/python/gedit.override:
	Fix "format not a string literal" compiler warning.



Modified:
   trunk/ChangeLog
   trunk/bindings/python/gedit.override
   trunk/data/   (props changed)
   trunk/gedit/gedit-app.c
   trunk/gedit/gedit-commands-file.c
   trunk/gedit/gedit-document-saver.c
   trunk/gedit/gedit-help.c
   trunk/gedit/gedit-local-document-saver.c
   trunk/gedit/gedit-mmap-document-loader.c
   trunk/gedit/gedit-module.c
   trunk/gedit/gedit-plugins-engine.c
   trunk/gedit/gedit-utils.c
   trunk/plugins/changecase/gedit-changecase-plugin.c
   trunk/plugins/docinfo/gedit-docinfo-plugin.c
   trunk/plugins/filebrowser/gedit-file-browser-plugin.c
   trunk/plugins/sort/gedit-sort-plugin.c
   trunk/plugins/time/gedit-time-plugin.c

Modified: trunk/bindings/python/gedit.override
==============================================================================
--- trunk/bindings/python/gedit.override	(original)
+++ trunk/bindings/python/gedit.override	Sun Sep  7 13:50:57 2008
@@ -426,7 +426,7 @@
                                  PyString_AsString (filename),
                                  PyInt_AsLong (lineno),
                                  PyString_AsString (funcname),
-                                 message);
+                                 "%s", message);
     }
     Py_DECREF (traceback);
     Py_DECREF (traceback_module);

Modified: trunk/gedit/gedit-app.c
==============================================================================
--- trunk/gedit/gedit-app.c	(original)
+++ trunk/gedit/gedit-app.c	Sun Sep  7 13:50:57 2008
@@ -209,7 +209,7 @@
 		if (error->domain != G_FILE_ERROR ||
 		    error->code != G_FILE_ERROR_NOENT)
 		{
-			g_warning (error->message);
+			g_warning ("%s", error->message);
 		}
 
 		g_error_free (error);
@@ -238,7 +238,7 @@
 				&error);
 	if (error)
 	{
-		g_warning (error->message);
+		g_warning ("%s", error->message);
 		g_error_free (error);
 	}
 
@@ -281,7 +281,7 @@
 		if (error->domain != G_FILE_ERROR ||
 		    error->code != G_FILE_ERROR_NOENT)
 		{
-			g_warning (error->message);
+			g_warning ("%s", error->message);
 		}
 
 		g_error_free (error);
@@ -310,7 +310,7 @@
 				    &error);
 	if (error)
 	{
-		g_warning (error->message);
+		g_warning ("%s", error->message);
 		g_error_free (error);
 	}
 

Modified: trunk/gedit/gedit-commands-file.c
==============================================================================
--- trunk/gedit/gedit-commands-file.c	(original)
+++ trunk/gedit/gedit-commands-file.c	Sun Sep  7 13:50:57 2008
@@ -625,7 +625,6 @@
 	gint ret;
 	gchar *parse_name;
 	gchar *name_for_display;
-	gchar *message;
 
 	gedit_debug (DEBUG_COMMANDS);
 
@@ -638,20 +637,17 @@
 	name_for_display = gedit_utils_str_middle_truncate (parse_name, 50);
 	g_free (parse_name);
 
-	message = g_strdup_printf (_("The file \"%s\" is read-only."),
-				   name_for_display);
-	g_free (name_for_display);
-
 	dialog = gtk_message_dialog_new (parent,
 					 GTK_DIALOG_DESTROY_WITH_PARENT,
 					 GTK_MESSAGE_QUESTION,
 					 GTK_BUTTONS_NONE,
-					 message);
+					 _("The file \"%s\" is read-only."),
+				         name_for_display);
+	g_free (name_for_display);
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
 						  _("Do you want to try to replace it "
 						    "with the one you are saving?"));
-	g_free (message);
 
 	gtk_dialog_add_button (GTK_DIALOG (dialog),
 			       GTK_STOCK_CANCEL,
@@ -1228,10 +1224,10 @@
 					 GTK_DIALOG_DESTROY_WITH_PARENT,
 					 GTK_MESSAGE_QUESTION,
 					 GTK_BUTTONS_NONE,
-					 primary_msg);
+					 "%s", primary_msg);
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-						  secondary_msg);
+						  "%s", secondary_msg);
 	g_free (primary_msg);
 	g_free (secondary_msg);
 

Modified: trunk/gedit/gedit-document-saver.c
==============================================================================
--- trunk/gedit/gedit-document-saver.c	(original)
+++ trunk/gedit/gedit-document-saver.c	Sun Sep  7 13:50:57 2008
@@ -388,7 +388,7 @@
 		g_set_error (error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 	}
 
 	return res;

Modified: trunk/gedit/gedit-help.c
==============================================================================
--- trunk/gedit/gedit-help.c	(original)
+++ trunk/gedit/gedit-help.c	Sun Sep  7 13:50:57 2008
@@ -82,8 +82,8 @@
 						 _("There was an error displaying help."));
 
 		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-							  error->message);
-							  
+							  "%s", error->message);
+
 		g_signal_connect (G_OBJECT (dialog),
 				  "response",
 				  G_CALLBACK (gtk_widget_destroy),

Modified: trunk/gedit/gedit-local-document-saver.c
==============================================================================
--- trunk/gedit/gedit-local-document-saver.c	(original)
+++ trunk/gedit/gedit-local-document-saver.c	Sun Sep  7 13:50:57 2008
@@ -199,7 +199,7 @@
 			g_set_error (error,
 				     G_IO_ERROR,
 				     g_io_error_from_errno (errno),
-				     g_strerror (errno));
+				     "%s", g_strerror (errno));
 
 			ret = FALSE;
 
@@ -220,7 +220,7 @@
 				g_set_error (error,
 					     G_IO_ERROR,
 					     g_io_error_from_errno (errno),
-					     g_strerror (errno));
+					     "%s", g_strerror (errno));
 
 				ret = FALSE;
 
@@ -299,7 +299,7 @@
 		g_set_error (&lsaver->priv->error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 
 		goto out;
 	}
@@ -470,7 +470,7 @@
 			g_set_error (&lsaver->priv->error,
 				     G_IO_ERROR,
 				     g_io_error_from_errno (errno),
-				     g_strerror (errno));
+				     "%s", g_strerror (errno));
 
 			close (tmpfd);
 			unlink (tmp_filename);
@@ -487,7 +487,7 @@
 			g_set_error (&lsaver->priv->error,
 				     G_IO_ERROR,
 				     g_io_error_from_errno (errno),
-				     g_strerror (errno));
+				     "%s", g_strerror (errno));
 
 			/* try to restore... no error checking */
 			rename (backup_filename, lsaver->priv->local_path);
@@ -507,7 +507,7 @@
 			g_set_error (&lsaver->priv->error,
 				     G_IO_ERROR,
 				     g_io_error_from_errno (errno),
-				     g_strerror (errno));
+				     "%s", g_strerror (errno));
 
 			close (tmpfd);
 			goto out;
@@ -693,7 +693,7 @@
 		g_set_error (&lsaver->priv->error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 
 		goto out;
 	}
@@ -739,7 +739,7 @@
 		g_set_error (&lsaver->priv->error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 
 		goto out;
 	}
@@ -812,7 +812,7 @@
 	g_set_error (&lsaver->priv->error,
 		     G_IO_ERROR,
 		     g_io_error_from_errno (errno),
-		     g_strerror (errno));
+		     "%s", g_strerror (errno));
 
 	next_phase = (GSourceFunc) open_local_failed;
 

Modified: trunk/gedit/gedit-mmap-document-loader.c
==============================================================================
--- trunk/gedit/gedit-mmap-document-loader.c	(original)
+++ trunk/gedit/gedit-mmap-document-loader.c	Sun Sep  7 13:50:57 2008
@@ -158,7 +158,7 @@
 		g_set_error (&mloader->priv->error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 
 		goto done;
 	}
@@ -217,7 +217,7 @@
 			g_set_error (&mloader->priv->error,
 				     G_IO_ERROR,
 				     g_io_error_from_errno (errno),
-				     g_strerror (errno));
+				     "%s", g_strerror (errno));
 
 			goto done;
 		}
@@ -243,9 +243,11 @@
 
 			ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
 			if (ret != 0)
+			{
 				g_warning ("File '%s' has not been correctly unmapped: %s",
 					   GEDIT_DOCUMENT_LOADER (mloader)->uri,
 					   g_strerror (errno));
+			}
 
 			goto done;
 		}
@@ -260,9 +262,11 @@
 		{
 			ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
 			if (ret != 0)
+			{
 				g_warning ("File '%s' has not been correctly unmapped: %s",
 					   GEDIT_DOCUMENT_LOADER (mloader)->uri,
 					   g_strerror (errno));
+			}
 
 			goto done;
 		}
@@ -282,20 +286,22 @@
 		}
 
 		ret = munmap (mapped_file, mloader->priv->statbuf.st_size);
-
 		if (ret != 0)
+		{
 			g_warning ("File '%s' has not been correctly unmapped: %s",
 				   GEDIT_DOCUMENT_LOADER (mloader)->uri,
 				   g_strerror (errno));
+		}
 	}
 
  done:
 	ret = close (mloader->priv->fd);
-
 	if (ret != 0)
+	{
 		g_warning ("File '%s' has not been correctly closed: %s",
 			   GEDIT_DOCUMENT_LOADER (mloader)->uri,
 			   g_strerror (errno));
+	}
 
 	mloader->priv->fd = -1;
 
@@ -333,7 +339,7 @@
 		g_set_error (&mloader->priv->error,
 			     G_IO_ERROR,
 			     g_io_error_from_errno (errno),
-			     g_strerror (errno));
+			     "%s", g_strerror (errno));
 
 		g_timeout_add_full (G_PRIORITY_HIGH,
 				    0,

Modified: trunk/gedit/gedit-module.c
==============================================================================
--- trunk/gedit/gedit-module.c	(original)
+++ trunk/gedit/gedit-module.c	Sun Sep  7 13:50:57 2008
@@ -70,7 +70,7 @@
 
 	if (module->library == NULL)
 	{
-		g_warning (g_module_error());
+		g_warning ("%s: %s", module->module_name, g_module_error());
 
 		return FALSE;
 	}
@@ -79,7 +79,7 @@
 	if (!g_module_symbol (module->library, "register_gedit_plugin",
 			      (void *) &register_func))
 	{
-		g_warning (g_module_error());
+		g_warning ("%s: %s", module->module_name, g_module_error());
 		g_module_close (module->library);
 
 		return FALSE;

Modified: trunk/gedit/gedit-plugins-engine.c
==============================================================================
--- trunk/gedit/gedit-plugins-engine.c	(original)
+++ trunk/gedit/gedit-plugins-engine.c	Sun Sep  7 13:50:57 2008
@@ -101,7 +101,7 @@
 	d = g_dir_open (dir, 0, &error);
 	if (!d)
 	{
-		g_warning (error->message);
+		g_warning ("%s", error->message);
 		g_error_free (error);
 		return;
 	}

Modified: trunk/gedit/gedit-utils.c
==============================================================================
--- trunk/gedit/gedit-utils.c	(original)
+++ trunk/gedit/gedit-utils.c	Sun Sep  7 13:50:57 2008
@@ -549,10 +549,10 @@
 			GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
 		   	GTK_MESSAGE_ERROR,
 		   	GTK_BUTTONS_OK,
-			str);
+			"%s", str);
 
 	g_free (str);
-	
+
 	if (wg != NULL)
 		gtk_window_group_add_window (wg, GTK_WINDOW (dialog));
 		

Modified: trunk/plugins/changecase/gedit-changecase-plugin.c
==============================================================================
--- trunk/plugins/changecase/gedit-changecase-plugin.c	(original)
+++ trunk/plugins/changecase/gedit-changecase-plugin.c	Sun Sep  7 13:50:57 2008
@@ -326,7 +326,7 @@
 							 &error);
 	if (data->ui_id == 0)
 	{
-		g_warning (error->message);
+		g_warning ("%s", error->message);
 		return;
 	}
 

Modified: trunk/plugins/docinfo/gedit-docinfo-plugin.c
==============================================================================
--- trunk/plugins/docinfo/gedit-docinfo-plugin.c	(original)
+++ trunk/plugins/docinfo/gedit-docinfo-plugin.c	Sun Sep  7 13:50:57 2008
@@ -116,8 +116,10 @@
 
 	if (!ret)
 	{
-		gedit_warning (GTK_WINDOW (window),
-			       gtk_label_get_label (GTK_LABEL (error_widget)));
+		const gchar *err_message;
+
+		err_message = gtk_label_get_label (GTK_LABEL (error_widget));
+		gedit_warning (GTK_WINDOW (window), "%s", err_message);
 
 		g_free (dialog);
 		gtk_widget_destroy (error_widget);

Modified: trunk/plugins/filebrowser/gedit-file-browser-plugin.c
==============================================================================
--- trunk/plugins/filebrowser/gedit-file-browser-plugin.c	(original)
+++ trunk/plugins/filebrowser/gedit-file-browser-plugin.c	Sun Sep  7 13:50:57 2008
@@ -901,9 +901,9 @@
 				      GTK_DIALOG_MODAL |
 				      GTK_DIALOG_DESTROY_WITH_PARENT,
 				      GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
-				      title);
+				      "%s", title);
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg),
-						  message);
+						  "%s", message);
 
 	gtk_dialog_run (GTK_DIALOG (dlg));
 	gtk_widget_destroy (dlg);

Modified: trunk/plugins/sort/gedit-sort-plugin.c
==============================================================================
--- trunk/plugins/sort/gedit-sort-plugin.c	(original)
+++ trunk/plugins/sort/gedit-sort-plugin.c	Sun Sep  7 13:50:57 2008
@@ -141,8 +141,10 @@
 
 	if (!ret)
 	{
-		gedit_warning (parent,
-			       gtk_label_get_label (GTK_LABEL (error_widget)));
+		const gchar *err_message;
+
+		err_message = gtk_label_get_label (GTK_LABEL (error_widget));
+		gedit_warning (parent, "%s", err_message);
 
 		g_free (dialog);
 		gtk_widget_destroy (error_widget);

Modified: trunk/plugins/time/gedit-time-plugin.c
==============================================================================
--- trunk/plugins/time/gedit-time-plugin.c	(original)
+++ trunk/plugins/time/gedit-time-plugin.c	Sun Sep  7 13:50:57 2008
@@ -936,8 +936,10 @@
 
 	if (!ret)
 	{
-		gedit_warning (parent,
-			       gtk_label_get_label (GTK_LABEL (error_widget)));
+		const gchar *err_message;
+
+		err_message = gtk_label_get_label (GTK_LABEL (error_widget));
+		gedit_warning (parent, "%s", err_message);
 
 		g_free (dialog);
 		gtk_widget_destroy (error_widget);



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