fix no-file-selected patch: change working directories

(#621778, fix by Pavel Polischouk)
This commit is contained in:
Nils Philippsen 2013-07-05 16:36:43 +02:00
parent 6f410728b5
commit c15033d78c
2 changed files with 30 additions and 11 deletions

View File

@ -1,11 +1,25 @@
From 705415aeae0117a8df984701ad39606439b39a65 Mon Sep 17 00:00:00 2001 From 2f7abcaa7ad39f118b2f49fdcba9c90b37b3d972 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com> From: Nils Philippsen <nils@redhat.com>
Date: Thu, 16 Aug 2012 10:58:07 +0200 Date: Fri, 5 Jul 2013 16:15:55 +0200
Subject: [PATCH] patch: no-file-selected Subject: [PATCH] patch: no-file-selected
Squashed commit of the following: Squashed commit of the following:
commit da2140208e30e87f4779593071b60654dcc187eb commit f887550276e324151947960292a7266c71aeb573
Author: Pavel Polischouk <pavel.polischouk@gmail.com>
Date: Fri Nov 25 23:55:49 2011 -0500
fix changing working directory (#621778)
The patch checks the value returned by xsane_back_gtk_get_filename. In
most places it will check the result properly (taking 0 for success),
except one case where it takes 0 for an error, and this happens in
xsane_browse_filename_callback (xsane-front-gtk.c). The new code would
abort copying the filename into preferences structure if 0 was returned,
and that's the OK case. I'm very curious how wonderfully it would blow
up if an actual error was returned, but that's a different story.
commit 2c02ddd8282fa231107d8860aee4d92bdb5cb8e8
Author: Nils Philippsen <nils@redhat.com> Author: Nils Philippsen <nils@redhat.com>
Date: Fri Nov 19 12:25:54 2010 +0100 Date: Fri Nov 19 12:25:54 2010 +0100
@ -16,7 +30,7 @@ Date: Fri Nov 19 12:25:54 2010 +0100
2 files changed, 21 insertions(+), 5 deletions(-) 2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c
index 4701dc6..91b5804 100644 index bca9eb2..6ef1506 100644
--- a/src/xsane-back-gtk.c --- a/src/xsane-back-gtk.c
+++ b/src/xsane-back-gtk.c +++ b/src/xsane-back-gtk.c
@@ -1111,6 +1111,11 @@ static void xsane_back_gtk_filetype2_callback(GtkWidget *widget, gpointer data) @@ -1111,6 +1111,11 @@ static void xsane_back_gtk_filetype2_callback(GtkWidget *widget, gpointer data)
@ -31,7 +45,7 @@ index 4701dc6..91b5804 100644
if ((new_filetype) && (*new_filetype)) if ((new_filetype) && (*new_filetype))
{ {
extension = strrchr(chooser_filename, '.'); extension = strrchr(chooser_filename, '.');
@@ -1501,12 +1506,19 @@ int xsane_back_gtk_get_filename(const char *label, const char *default_name, siz @@ -1505,12 +1510,19 @@ int xsane_back_gtk_get_filename(const char *label, const char *default_name, siz
#endif #endif
chooser_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filechooser)); chooser_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filechooser));
@ -56,7 +70,7 @@ index 4701dc6..91b5804 100644
gtk_widget_destroy(filechooser); gtk_widget_destroy(filechooser);
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 35aa89d..08761a0 100644 index 4c973fb..7bb49b0 100644
--- a/src/xsane-front-gtk.c --- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c +++ b/src/xsane-front-gtk.c
@@ -1333,7 +1333,11 @@ static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data) @@ -1333,7 +1333,11 @@ static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data)
@ -64,7 +78,7 @@ index 35aa89d..08761a0 100644
umask((mode_t) preferences.directory_umask); /* define new file permissions */ umask((mode_t) preferences.directory_umask); /* define new file permissions */
- xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES); - xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES);
+ if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES)) + if (xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, &preferences.filetype, &preferences.cms_function, XSANE_FILE_CHOOSER_ACTION_SELECT_SAVE, show_extra_widgets, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_IMAGES, XSANE_FILE_FILTER_IMAGES) < 0)
+ { + {
+ xsane_set_sensitivity(TRUE); + xsane_set_sensitivity(TRUE);
+ return; + return;
@ -73,5 +87,5 @@ index 35aa89d..08761a0 100644
if (preferences.filename) if (preferences.filename)
-- --
1.7.11.4 1.8.3.1

View File

@ -20,7 +20,7 @@
Name: xsane Name: xsane
Summary: X Window System front-end for the SANE scanner interface Summary: X Window System front-end for the SANE scanner interface
Version: 0.999 Version: 0.999
Release: 2%{?dist} Release: 3%{?dist}
Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
Source1: xsane-256x256.png Source1: xsane-256x256.png
# use "xdg-open" instead of "netscape" to launch help browser # use "xdg-open" instead of "netscape" to launch help browser
@ -36,8 +36,9 @@ Patch2: xsane-0.996-no-eula.patch
# submitted to upstream (Oliver Rauch) via email, 2010-06-23 # submitted to upstream (Oliver Rauch) via email, 2010-06-23
Patch3: xsane-0.997-off-root-build.patch Patch3: xsane-0.997-off-root-build.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=608047 # https://bugzilla.redhat.com/show_bug.cgi?id=608047
# submitted to upstream (Oliver Rauch) via email, 2010-07-13 # https://bugzilla.redhat.com/show_bug.cgi?id=621778
Patch4: xsane-0.997-no-file-selected.patch # submitted to upstream (Oliver Rauch) via email, 2013-07-05
Patch4: xsane-0.999-no-file-selected.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=198422 # https://bugzilla.redhat.com/show_bug.cgi?id=198422
# submitted to upstream (Oliver Rauch) via email, 2010-06-29 # submitted to upstream (Oliver Rauch) via email, 2010-06-29
Patch5: xsane-0.997-ipv6.patch Patch5: xsane-0.997-ipv6.patch
@ -222,6 +223,10 @@ fi
%{_datadir}/sane/xsane %{_datadir}/sane/xsane
%changelog %changelog
* Fri Jul 05 2013 Nils Philippsen <nils@redhat.com> - 0.999-3
- fix no-file-selected patch: change working directories (#621778, fix by Pavel
Polischouk)
* Thu Jun 27 2013 Nils Philippsen <nils@redhat.com> - 0.999-2 * Thu Jun 27 2013 Nils Philippsen <nils@redhat.com> - 0.999-2
- ensure correct autoconf patch is used - ensure correct autoconf patch is used