Your message dated Fri, 12 Jun 2009 18:32:04 +0000
with message-id <[email protected]>
and subject line Bug#530996: fixed in gthumb 3:2.10.11-2
has caused the Debian Bug report #530996,
regarding gthumb:  overwrite dialog should suggest new name
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
530996: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530996
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Subject: gthumb: overwrite dialog should suggest new name
Package: gthumb
Version: 3:2.10.11-1
Severity: wishlist
Tags: patch

*** Please type your report below this line ***
When moving images around, if you happen to have two files of the same name, an 
overwrite dialog appears. One of the options is to rename the new file; the 
text box presents the original file name and allows you to edit that.

I find it's more useful if the textbox instead presents you with a suggested 
alternate name, the way Konqueror's overwrite dialog does, so that you can 
just select that radio box and click OK, rather than having to type into the 
box (and keep track of how many similarly-named images you're trying to move).

I've included a patch that adds this functionality. If you have "Picture.jpg", 
the name "Picture_1.jpg" will be suggested. If that isn't available, then 
"Picture_2.jpg" will be suggested, and so on.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gthumb depends on:
ii  gthumb-data                3:2.10.11-1   an image viewer and browser - 
arch
ii  libart-2.0-2               2.3.20-2      Library of functions for 2D 
graphi
ii  libbonobo2-0               2.24.1-1      Bonobo CORBA interfaces library
ii  libc6                      2.9-12        GNU C Library: Shared libraries
ii  libcairo2                  1.8.6-2+b1    The Cairo 2D vector graphics 
libra
ii  libexif12                  0.6.17-1      library to parse EXIF files
ii  libgconf2-4                2.26.0-1      GNOME configuration database syste
ii  libglade2-0                1:2.6.4-1     library to load .glade files at ru
ii  libglib2.0-0               2.20.1-2      The GLib library of C routines
ii  libgnome2-0                2.26.0-1      The GNOME library - runtime files
ii  libgnomecanvas2-0          2.26.0-1      A powerful object-oriented 
display
ii  libgnomeui-0               2.24.1-1      The GNOME 2 libraries (User 
Interf
ii  libgnomevfs2-0             1:2.24.1-1    GNOME Virtual File System 
(runtime
ii  libgphoto2-2               2.4.5-1       gphoto2 digital camera library
ii  libgphoto2-port0           2.4.5-1       gphoto2 digital camera port 
librar
ii  libgtk2.0-0                2.16.1-2      The GTK+ graphical user interface 
ii  libiptcdata0               1.0.3-1       Library to parse IPTC metadata
ii  libjpeg62                  6b-14         The Independent JPEG Group's JPEG 
ii  libopenrawgnome1           0.0.7-1       free implementation for RAW 
decodi
ii  liborbit2                  1:2.14.17-0.1 libraries for ORBit2 - a CORBA 
ORB
ii  libpango1.0-0              1.24.0-3+b1   Layout and rendering of 
internatio
ii  libpng12-0                 1.2.35-1      PNG library - runtime
ii  libtiff4                   3.8.2-11      Tag Image File Format (TIFF) libra
ii  libx11-6                   2:1.2.1-1     X11 client-side library
ii  libxml2                    2.7.3.dfsg-1  GNOME XML library
ii  libxrender1                1:0.9.4-2     X Rendering Extension client 
libra

gthumb recommends no packages.

gthumb suggests no packages.

-- no debconf information

diff -Naur gthumb-2.10.11-old/src/.directory gthumb-2.10.11-new-uncompiled/src/.directory
--- gthumb-2.10.11-old/src/.directory	1969-12-31 16:00:00.000000000 -0800
+++ gthumb-2.10.11-new-uncompiled/src/.directory	2009-05-28 15:13:40.000000000 -0700
@@ -0,0 +1,3 @@
+[Dolphin]
+Timestamp=2009,5,28,15,13,40
+ViewMode=1
diff -Naur gthumb-2.10.11-old/src/dlg-file-utils.c gthumb-2.10.11-new-uncompiled/src/dlg-file-utils.c
--- gthumb-2.10.11-old/src/dlg-file-utils.c	2009-02-24 02:18:11.000000000 -0800
+++ gthumb-2.10.11-new-uncompiled/src/dlg-file-utils.c	2009-05-28 20:43:26.000000000 -0700
@@ -23,6 +23,8 @@
 #include <config.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
@@ -592,6 +594,33 @@
 				  gtk_toggle_button_get_active (button));
 }
 
+const char *file_name_from_path_uniquify(const char *file_name)
+{
+	/* return a (hopefully) unique filename within a directory. Return the original filename on failure. */
+	int malloc_size = strlen(file_name) + DLG_FILE_MAX_RNAMECHR + 2;
+	int i;
+
+	char *name_copy = malloc(strlen(file_name));
+	char *exten;
+	char *temp = malloc( malloc_size );
+
+	exten = strrchr(name_copy,'.')+1;
+	*strrchr(name_copy,'.') = 0;
+
+	for (i = 1; i < DLG_FILE_MAX_RENAME; i++) {
+		snprintf(temp, (size_t) malloc_size, "%s_%d.%s", name_copy, i, exten);
+		if (path_is_file (temp)) {
+			continue;
+		}
+		else {
+			free(name_copy);
+			return file_name_from_path(temp);
+		}
+	}
+	free(name_copy);
+	return file_name_from_path(file_name);
+}
+   
 
 static DlgOverwriteData *
 create_overwrite_dialog (GthWindow         *window,
@@ -698,7 +727,7 @@
 	gtk_widget_set_sensitive (owdata->overwrite_rename_entry,
 				  default_overwrite_mode == OVERWRITE_RESULT_RENAME);
 	_gtk_entry_set_filename_text (GTK_ENTRY (owdata->overwrite_rename_entry),
-				      file_name_from_path (new_filename));
+				      file_name_from_path_uniquify (new_filename));
 	if (default_overwrite_mode == OVERWRITE_RESULT_RENAME)
 		gtk_widget_grab_focus (owdata->overwrite_rename_entry);
 
diff -Naur gthumb-2.10.11-old/src/dlg-file-utils.h gthumb-2.10.11-new-uncompiled/src/dlg-file-utils.h
--- gthumb-2.10.11-old/src/dlg-file-utils.h	2009-02-24 02:18:11.000000000 -0800
+++ gthumb-2.10.11-new-uncompiled/src/dlg-file-utils.h	2009-05-28 20:07:54.000000000 -0700
@@ -26,6 +26,8 @@
 #include <libgnomevfs/gnome-vfs-result.h>
 #include "gth-window.h"
 
+#define DLG_FILE_MAX_RENAME 1000
+#define DLG_FILE_MAX_RNAMECHR 4
 
 gboolean dlg_file_delete__confirm   (GthWindow   *window,
 				     GList       *list,

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---
--- Begin Message ---
Source: gthumb
Source-Version: 3:2.10.11-2

We believe that the bug you reported is fixed in the latest version of
gthumb, which is due to be installed in the Debian FTP archive:

gthumb-data_2.10.11-2_all.deb
  to pool/main/g/gthumb/gthumb-data_2.10.11-2_all.deb
gthumb_2.10.11-2.diff.gz
  to pool/main/g/gthumb/gthumb_2.10.11-2.diff.gz
gthumb_2.10.11-2.dsc
  to pool/main/g/gthumb/gthumb_2.10.11-2.dsc
gthumb_2.10.11-2_i386.deb
  to pool/main/g/gthumb/gthumb_2.10.11-2_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David Paleino <[email protected]> (supplier of updated gthumb package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 12 Jun 2009 19:56:08 +0200
Source: gthumb
Binary: gthumb gthumb-data
Architecture: source all i386
Version: 3:2.10.11-2
Distribution: unstable
Urgency: low
Maintainer: [email protected]
Changed-By: David Paleino <[email protected]>
Description: 
 gthumb     - an image viewer and browser
 gthumb-data - an image viewer and browser - arch-independent files
Closes: 326699 441687 524412 530996
Changes: 
 gthumb (3:2.10.11-2) unstable; urgency=low
 .
   * debian/patches:
     - 10-fix_POTFILES.skip.patch refreshed
     - 13-fix_Close_mismatch.patch added (Closes: #524412)
     - 14-add_rotate_button_viewer.patch added (Closes: #326699)
     - 15-suggest_new_name_on_overwrite_dialog.patch added, thanks
       to Jack T Mudge III (Closes: #530996)
     - 16-fix_crop_dialog_usability.patch added, taken from git's
       d4a737f458f2cae9d16cbdbb62bd120b94a5605c (Closes: #441687)
Checksums-Sha1: 
 9809d9e4c217e2d49571c8c6408b2bd92e845d39 1588 gthumb_2.10.11-2.dsc
 d9c2548266000a1d5d00b78888294dd940e2ff90 37491 gthumb_2.10.11-2.diff.gz
 dd216837cea3e540e72206d2cedf8c8b252e1b44 2516614 gthumb-data_2.10.11-2_all.deb
 f2008112dca233267c827d0addf29a33e1c8a96a 656084 gthumb_2.10.11-2_i386.deb
Checksums-Sha256: 
 1cfa5a4ce03d8ceffc52b29c037825135f6b20b28c2db6ad1a40ca6894586aff 1588 
gthumb_2.10.11-2.dsc
 55857cb3807ef2f0c052bb110efa103295d2db4048a478bb22ec197547396136 37491 
gthumb_2.10.11-2.diff.gz
 a92f4b091b550250ef67976b093fddc256fa47a617102471cf0d6ef7c8727d60 2516614 
gthumb-data_2.10.11-2_all.deb
 0ce538a5c7bfc7255b98e2efd2013a49b9ccefc991eba623fde42620877d5eca 656084 
gthumb_2.10.11-2_i386.deb
Files: 
 b49bc943745af80810f56204d5b54d5a 1588 gnome optional gthumb_2.10.11-2.dsc
 2650941c053cd29280531e9318241e4a 37491 gnome optional gthumb_2.10.11-2.diff.gz
 de836cf0112514f5e4074f0d5202683b 2516614 gnome optional 
gthumb-data_2.10.11-2_all.deb
 518cd0efdbe174acc2355a5bb88f249f 656084 gnome optional 
gthumb_2.10.11-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoynPAACgkQ5qqQFxOSsXQMLACfbHkJx7rOqx21cwp7b4uhGoAv
HSoAoKY8zTHQ6joHahDKnLzNRVEs5/yo
=4Joj
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to