Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Hi,

please unblock gedit to push a handful of upstream fixes.

gedit (3.14.0-3) unstable; urgency=medium

  * 10_external-tools_missing_column.patch: patch from upstream git. 
    Fixes a typo in the external tools plugin.
  * 11_quick-open_crash_IM.patch: patch from upstream git. Fix a bug in 
    the quick-open plugin that makes the input manager crash.
  * 12_send-to-fpaste_path.patch: patch from upstream git. Fix python3 
    shebang.
  * 13_window_size.patch: patch from upstream git. Increase the default 
    window size.
  * 14_css_leak.patch: patch from upstream git. Avoid a GFile leak when 
    loading a nonexistent CSS.
  * 15_line_ending.patch: patch from upstream git. Bring back the 
    ability to set line endings.
  * 16_highlightmode_dialog.patch: patch from upstream git. Fix the 
    language selector.
  * 17_various_leaks.patch: patch from upstream git. Fix several memory 
    leaks.
  * 18_print-preview_typo.patch: patch from upstream git. Fix a typo in 
    the print preview.

I’m attaching all individual patches, which represent the sole changes.

unblock gedit/3.14.0-3

Thanks,
-- 
 .''`.        Josselin Mouette
: :' :
`. `'
  `-
>From d0cb344dfe6355be2025e061f772227b7550766d Mon Sep 17 00:00:00 2001
From: Sebastien Lafargue <slafar...@gnome.org>
Date: Sun, 28 Sep 2014 15:58:50 +0200
Subject: plugin: externaltools/send-to-fpaste missing colon


diff --git a/plugins/externaltools/data/send-to-fpaste.tool.in b/plugins/externaltools/data/send-to-fpaste.tool.in
index 0070f57..e3edaca 100755
--- a/plugins/externaltools/data/send-to-fpaste.tool.in
+++ b/plugins/externaltools/data/send-to-fpaste.tool.in
@@ -4,7 +4,7 @@ import os, urllib, json, sys, urllib.request
 from gi.repository import Gtk, Gdk
 
 lang = os.getenv('GEDIT_CURRRENT_DOCUMENT_LANGUAGE')
-if lang is None
+if lang is None:
     lang = "text"
 
 current_document_path = os.getenv('GEDIT_CURRENT_DOCUMENT_PATH')
-- 
cgit v0.10.1

>From 634f66b43779c00631903865dd2c93f4c58e64dc Mon Sep 17 00:00:00 2001
From: Adam Dingle <a...@medovina.org>
Date: Wed, 1 Oct 2014 10:45:58 -0400
Subject: [quick open] Defer popup destruction to avoid input manager crash

https://bugzilla.gnome.org/show_bug.cgi?id=737711

diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index 2ccb53f..c2c16f8 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -519,13 +519,15 @@ class Popup(Gtk.Dialog):
                 return True
 
         if rows and ret:
-            self.destroy()
+            # We destroy the popup in an idle callback to work around a crash that happens with
+            # GTK_IM_MODULE=xim.  See https://bugzilla.gnome.org/show_bug.cgi?id=737711 .
+            GLib.idle_add(self.destroy)
 
         if not rows:
             gfile = self._direct_file()
 
             if gfile and self._handler(gfile):
-                self.destroy()
+                GLib.idle_add(self.destroy)
             else:
                 ret = False
         else:
-- 
cgit v0.10.1

>From a9fd3f931a6e2cbd282b293f6b0b3828bfbd18f2 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dims...@opensuse.org>
Date: Sun, 5 Oct 2014 17:10:20 +0200
Subject: send-to-fpaste: use /usr/bin/env instead of /bin/env

In light of the larger /usr - movement, it would be nicer to use
/usr/bin/env instead of /bin/env. Some distros do not offer /bin/env
(and never have). All other files refering to 'env' look for it in
/usr/bin as well, so it's just consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=737931

diff --git a/plugins/externaltools/data/send-to-fpaste.tool.in b/plugins/externaltools/data/send-to-fpaste.tool.in
index e3edaca..d255007 100755
--- a/plugins/externaltools/data/send-to-fpaste.tool.in
+++ b/plugins/externaltools/data/send-to-fpaste.tool.in
@@ -1,4 +1,4 @@
-#!/bin/env python3
+#!/usr/bin/env python3
 
 import os, urllib, json, sys, urllib.request
 from gi.repository import Gtk, Gdk
-- 
cgit v0.10.1

>From 8263561b56601217d97847b5138c22bc90fe5b41 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanz...@gnome.org>
Date: Sun, 5 Oct 2014 08:49:08 -0500
Subject: Increase default window size

https://bugzilla.gnome.org/show_bug.cgi?id=729330

diff --git a/data/org.gnome.gedit.gschema.xml.in b/data/org.gnome.gedit.gschema.xml.in
index 5d17827..a01b3ec 100644
--- a/data/org.gnome.gedit.gschema.xml.in
+++ b/data/org.gnome.gedit.gschema.xml.in
@@ -258,7 +258,7 @@
       <default>0</default>
     </key>
     <key name="size" type="(ii)">
-      <default>(650, 500)</default>
+      <default>(900, 700)</default>
     </key>
     <key name="side-panel-size" type="i">
       <default>200</default>
-- 
cgit v0.10.1

>From 0bebb1a24030e2456729db8c485cfaa2ae208c27 Mon Sep 17 00:00:00 2001
From: Paolo Borelli <pbore...@gnome.org>
Date: Sun, 19 Oct 2014 12:53:26 +0200
Subject: Do not leak GFile when trying to load a non existing css


diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index c502f09..dc5d803 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -493,6 +493,7 @@ load_css_from_resource (const gchar *filename,
 
 	if (!required && !g_file_query_exists (css_file, NULL))
 	{
+		g_object_unref (css_file);
 		return;
 	}
 
-- 
cgit v0.10.1

>From c445571bd940294ca68f1605b8c57d4d48c56001 Mon Sep 17 00:00:00 2001
From: Ignacio Casal Quinteiro <i...@gnome.org>
Date: Tue, 4 Nov 2014 12:18:19 +0100
Subject: file chooser: get back the line ending change on saving

This was removed by mistake on the refactoring.

diff --git a/gedit/gedit-file-chooser-dialog-gtk.c b/gedit/gedit-file-chooser-dialog-gtk.c
index ec58b09..4386462 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -330,6 +330,15 @@ create_option_menu (GeditFileChooserDialogGtk *dialog,
 }
 
 static void
+update_newline_visibility (GeditFileChooserDialogGtk *dialog)
+{
+	gboolean visible = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog)) == GTK_FILE_CHOOSER_ACTION_SAVE;
+
+	gtk_widget_set_visible (dialog->priv->newline_label, visible);
+	gtk_widget_set_visible (dialog->priv->newline_combo, visible);
+}
+
+static void
 newline_combo_append (GtkComboBox          *combo,
 		      GtkListStore         *store,
 		      GtkTreeIter          *iter,
@@ -404,6 +413,8 @@ create_newline_combo (GeditFileChooserDialogGtk *dialog)
 	dialog->priv->newline_combo = combo;
 	dialog->priv->newline_label = label;
 	dialog->priv->newline_store = store;
+
+	update_newline_visibility (dialog);
 }
 
 static void
@@ -440,6 +451,36 @@ create_extra_widget (GeditFileChooserDialogGtk *dialog,
 }
 
 static void
+action_changed (GeditFileChooserDialogGtk *dialog,
+		GParamSpec                *pspec,
+		gpointer                   data)
+{
+	GtkFileChooserAction action;
+
+	action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (dialog));
+
+	switch (action)
+	{
+		case GTK_FILE_CHOOSER_ACTION_OPEN:
+			g_object_set (dialog->priv->option_menu,
+				      "save_mode", FALSE,
+				      NULL);
+			gtk_widget_show (dialog->priv->option_menu);
+			break;
+		case GTK_FILE_CHOOSER_ACTION_SAVE:
+			g_object_set (dialog->priv->option_menu,
+				      "save_mode", TRUE,
+				      NULL);
+			gtk_widget_show (dialog->priv->option_menu);
+			break;
+		default:
+			gtk_widget_hide (dialog->priv->option_menu);
+	}
+
+	update_newline_visibility (dialog);
+}
+
+static void
 filter_changed (GeditFileChooserDialogGtk *dialog,
 		GParamSpec	       *pspec,
 		gpointer		data)
@@ -587,6 +628,11 @@ gedit_file_chooser_dialog_gtk_create (const gchar             *title,
 
 	create_extra_widget (GEDIT_FILE_CHOOSER_DIALOG_GTK (result), flags);
 
+	g_signal_connect (result,
+			  "notify::action",
+			  G_CALLBACK (action_changed),
+			  NULL);
+
 	if (encoding != NULL)
 	{
 		gedit_encodings_combo_box_set_selected_encoding (
-- 
cgit v0.10.1

>From 1d88423668f829f6f28581232bf223f0525f3bc8 Mon Sep 17 00:00:00 2001
From: Sebastien Lafargue <slafar...@gnome.org>
Date: Wed, 5 Nov 2014 17:59:56 +0100
Subject: HighLightMode dialog: fix

The selector is destroyed before we had time to activate the
selected language.

diff --git a/gedit/gedit-highlight-mode-dialog.c b/gedit/gedit-highlight-mode-dialog.c
index 81ed4d5..bb5c75a 100644
--- a/gedit/gedit-highlight-mode-dialog.c
+++ b/gedit/gedit-highlight-mode-dialog.c
@@ -25,6 +25,7 @@
 struct _GeditHighlightModeDialogPrivate
 {
 	GeditHighlightModeSelector *selector;
+	gulong                      on_language_selected_id;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GeditHighlightModeDialog, gedit_highlight_mode_dialog, GTK_TYPE_DIALOG)
@@ -37,13 +38,12 @@ gedit_highlight_mode_dialog_response (GtkDialog *dialog,
 
 	if (response_id == GTK_RESPONSE_OK)
 	{
-		/* The dialog will be destroyed if a language is selected */
+		g_signal_handler_block (priv->selector, priv->on_language_selected_id);
 		gedit_highlight_mode_selector_activate_selected_language (priv->selector);
+		g_signal_handler_unblock (priv->selector, priv->on_language_selected_id);
 	}
-	else
-	{
-		gtk_widget_destroy (GTK_WIDGET (dialog));
-	}
+
+	gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 static void
@@ -51,6 +51,12 @@ on_language_selected (GeditHighlightModeSelector *sel,
                       GtkSourceLanguage          *language,
                       GtkDialog                  *dialog)
 {
+	GeditHighlightModeDialogPrivate *priv = GEDIT_HIGHLIGHT_MODE_DIALOG (dialog)->priv;
+
+	g_signal_handler_block (priv->selector, priv->on_language_selected_id);
+	gedit_highlight_mode_selector_activate_selected_language (priv->selector);
+	g_signal_handler_unblock (priv->selector, priv->on_language_selected_id);
+
 	gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
@@ -76,8 +82,8 @@ gedit_highlight_mode_dialog_init (GeditHighlightModeDialog *dlg)
 	gtk_widget_init_template (GTK_WIDGET (dlg));
 	gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_OK);
 
-	g_signal_connect (dlg->priv->selector, "language-selected",
-	                  G_CALLBACK (on_language_selected), dlg);
+	dlg->priv->on_language_selected_id = g_signal_connect (dlg->priv->selector, "language-selected",
+	                                                       G_CALLBACK (on_language_selected), dlg);
 }
 
 GtkWidget *
-- 
cgit v0.10.1

>From 62b0a0289bf8536bd528a26a60e01a987099ba98 Mon Sep 17 00:00:00 2001
From: Boris Egorov <ego...@linux.com>
Date: Wed, 19 Nov 2014 23:52:12 +0600
Subject: Fix some memory leaks [cppcheck]

Signed-off-by: Boris Egorov <ego...@linux.com>

https://bugzilla.gnome.org/show_bug.cgi?id=740382

diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index db71a9a..a907d13 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -657,7 +657,10 @@ file_copy (const gchar  *name,
 		return FALSE;
 
 	if (!g_file_set_contents (dest_name, contents, length, error))
+	{
+		g_free (contents);
 		return FALSE;
+	}
 
 	g_free (contents);
 
@@ -709,10 +712,13 @@ install_style_scheme (const gchar *fname)
 		if (!file_copy (fname, new_file_name, &error))
 		{
 			g_free (new_file_name);
+			g_free (dirname);
 
 			g_message ("Cannot install style scheme:\n%s",
 				   error->message);
 
+			g_error_free (error);
+
 			return NULL;
 		}
 
diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
index 4448cb4..0f1dec7 100644
--- a/gedit/gedit-utils.c
+++ b/gedit/gedit-utils.c
@@ -1194,9 +1194,11 @@ gedit_utils_drop_get_uris (GtkSelectionData *selection_data)
 	if (*uri_list == NULL)
 	{
 		g_free(uri_list);
+		g_strfreev (uris);
 		return NULL;
 	}
 
+	g_strfreev (uris);
 	return uri_list;
 }
 
-- 
cgit v0.10.1

>From e30939812fcf884d031757fb3cc2a8383f3ce21f Mon Sep 17 00:00:00 2001
From: Boris Egorov <ego...@linux.com>
Date: Thu, 20 Nov 2014 10:46:27 +0600
Subject: Fix a typo in get_page_at_coords() [cppcheck]

Both height and width of a tile must be positive.

Issue detected by cppcheck.

Signed-off-by: Boris Egorov <ego...@linux.com>

https://bugzilla.gnome.org/show_bug.cgi?id=740382

diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c
index 24f72ff..b4cf576 100644
--- a/gedit/gedit-print-preview.c
+++ b/gedit/gedit-print-preview.c
@@ -567,7 +567,7 @@ get_page_at_coords (GeditPrintPreview *preview,
 
 	priv = preview->priv;
 
-	if (priv->tile_h <= 0 || priv->tile_h <= 0)
+	if (priv->tile_h <= 0 || priv->tile_w <= 0)
 		return -1;
 
 	get_adjustments (preview, &hadj, &vadj);
-- 
cgit v0.10.1

Reply via email to