Hello community, here is the log from the commit of package f-spot checked in at Sat Jun 10 11:57:41 CEST 2006. -------- --- GNOME/f-spot/f-spot.changes 2006-06-09 21:09:10.000000000 +0200 +++ f-spot/f-spot.changes 2006-06-10 00:15:44.000000000 +0200 @@ -1,0 +2,7 @@ +Fri Jun 9 21:05:53 CEST 2006 - lewing@suse.de + +- Fix exif description bug. (#183006) +- Fix open with exception handling. (#181090) +- Enable translations in screensaver. (#179466) + +------------------------------------------------------------------- New: ---- f-spot-exifexception.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ f-spot.spec ++++++ --- /var/tmp/diff_new_pack.eEVAbp/_old 2006-06-10 11:57:31.000000000 +0200 +++ /var/tmp/diff_new_pack.eEVAbp/_new 2006-06-10 11:57:31.000000000 +0200 @@ -19,7 +19,7 @@ Autoreqprov: on Requires: dcraw Version: 0.1.11 -Release: 32 +Release: 33 Summary: GNOME Photo Management Application URL: http://www.gnome.org/projects/f-spot/ Source: %{name}-%{version}.tar.bz2 @@ -53,6 +53,7 @@ Patch25: %{name}-tiffloop.patch Patch26: %{name}-dontduplicate.patch Patch27: %{name}-importugly.patch +Patch28: %{name}-exifexception.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: mono-core nautilus-cd-burner dbus-1-x11 @@ -106,6 +107,7 @@ %patch25 %patch26 %patch27 +%patch28 %build rename no nb po/no.* @@ -166,6 +168,10 @@ %changelog -n f-spot * Fri Jun 09 2006 - gekker@suse.de - Update translation for cs +* Fri Jun 09 2006 - lewing@suse.de +- Fix exif description bug. (#183006) +- Fix open with exception handling. (#181090) +- Enable translations in screensaver. (#179466) * Wed Jun 07 2006 - gekker@suse.de - Fix typo in specfile, actually use translation updates (#179466) * Fri Jun 02 2006 - lewing@suse.de ++++++ f-spot-exifexception.patch ++++++ Index: src/Db.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/Db.cs,v retrieving revision 1.17.2.2 diff -u -p -r1.17.2.2 Db.cs --- src/Db.cs 9 May 2006 22:56:24 -0000 1.17.2.2 +++ src/Db.cs 9 Jun 2006 22:12:15 -0000 @@ -324,13 +324,13 @@ public class Db : IDisposable { sqlite_connection.Open (); - BeginTransaction (); - // Load or create the meta table meta_store = new MetaStore (sqlite_connection, new_db); // Update the database schema if necessary FSpot.Database.Updater.Run (this); + + BeginTransaction (); tag_store = new TagStore (sqlite_connection, new_db); import_store = new ImportStore (sqlite_connection, new_db); Index: src/Exif.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/Exif.cs,v retrieving revision 1.16 diff -u -p -r1.16 Exif.cs --- src/Exif.cs 7 Dec 2005 07:49:44 -0000 1.16 +++ src/Exif.cs 9 Jun 2006 22:12:16 -0000 @@ -526,7 +526,10 @@ namespace Exif { get { unsafe { byte [] data = new byte [_handle->size]; - Marshal.Copy (_handle->data, data, 0, (int)_handle->size); + + if (data.Length > 0) + Marshal.Copy (_handle->data, data, 0, (int)_handle->size); + return data; } } Index: src/HigMessageDialog.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/HigMessageDialog.cs,v retrieving revision 1.2 diff -u -p -r1.2 HigMessageDialog.cs --- src/HigMessageDialog.cs 20 Feb 2006 17:46:48 -0000 1.2 +++ src/HigMessageDialog.cs 9 Jun 2006 22:12:16 -0000 @@ -1,9 +1,59 @@ using System; +using Mono.Unix; +using Gtk; + +namespace FSpot { + public class EditException : Exception + { + IBrowsableItem item; + + public IBrowsableItem Item { + get { return item; } + } + + public EditException (IBrowsableItem item, Exception e) : base ( + String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to save photo {1}"), + e.Message, item.Name), e) + { + this.item = item; + } + } + + public class EditExceptionDialog : HigMessageDialog + { + private const int MaxErrors = 10; + + public EditExceptionDialog (Gtk.Window parent, Exception [] errors) : base (parent, DialogFlags.DestroyWithParent, + Gtk.MessageType.Error, ButtonsType.Ok, + Catalog.GetString ("Error editing photo"), + GenerateMessage (errors)) + { + } + + public EditExceptionDialog (Gtk.Window parent, Exception e, IBrowsableItem item) : this (parent, new EditException (item, e)) + { + } + + public EditExceptionDialog (Gtk.Window parent, Exception e) : this (parent, new Exception [] { e }) + { + } + + private static string GenerateMessage (Exception [] errors) + { + string desc = ""; + for (int i = 0; i < errors.Length && i < MaxErrors; i++) { + Exception e = errors [i]; + desc += e.Message + "\n"; + } + return desc; + } + } +} + // created on 24/01/2005 at 20:14 // Taken pretty much wholesale from Tomboy public class HigMessageDialog : Gtk.Dialog { - Gtk.AccelGroup accel_group; public HigMessageDialog (Gtk.Window parent, Index: src/ImportCommand.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/ImportCommand.cs,v retrieving revision 1.59.2.4 diff -u -p -r1.59.2.4 ImportCommand.cs --- src/ImportCommand.cs 5 Jun 2006 18:09:38 -0000 1.59.2.4 +++ src/ImportCommand.cs 9 Jun 2006 22:12:16 -0000 @@ -686,7 +686,7 @@ public class ImportCommand : FSpot.Glade private void HandleNewTagSelected (object sender, EventArgs args) { - Tag new_tag = MainWindow.Toplevel.CreateTag (); + Tag new_tag = MainWindow.Toplevel.CreateTag (Dialog, null); if (new_tag != null) { CreateTagMenu (); Index: src/InfoBox.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/InfoBox.cs,v retrieving revision 1.20 diff -u -p -r1.20 InfoBox.cs --- src/InfoBox.cs 23 Feb 2006 05:21:36 -0000 1.20 +++ src/InfoBox.cs 9 Jun 2006 22:12:16 -0000 @@ -270,8 +270,8 @@ public class InfoBox : VBox { date_label.Text = info.Date; #else date_label.Text = String.Format ("{0}\n{1}", - photo.Time.ToShortDateString (), - photo.Time.ToShortTimeString ()); + photo.Time.ToLocalTime ().ToShortDateString (), + photo.Time.ToLocalTime ().ToShortTimeString ()); #endif version_option_menu.Sensitive = true; PhotoVersionMenu menu = new PhotoVersionMenu (photo); Index: src/JpegFile.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/JpegFile.cs,v retrieving revision 1.31 diff -u -p -r1.31 JpegFile.cs --- src/JpegFile.cs 1 Mar 2006 04:12:25 -0000 1.31 +++ src/JpegFile.cs 9 Jun 2006 22:12:16 -0000 @@ -56,14 +56,19 @@ namespace FSpot { public override string Description { get { - Exif.ExifContent exif_content = this.ExifData.GetContents (Exif.Ifd.Exif); - Exif.ExifEntry entry = exif_content.Lookup (Exif.Tag.UserComment); - - if (entry == null) + try { + Exif.ExifContent exif_content = this.ExifData.GetContents (Exif.Ifd.Exif); + Exif.ExifEntry entry = exif_content.Lookup (Exif.Tag.UserComment); + + if (entry == null) + return null; + + UserComment comment = new UserComment (entry.Data, entry.ByteOrder == Exif.ByteOrder.Intel); + return comment.Value; + } catch (Exception e) { + // errors here shouldn't be fatal return null; - - UserComment comment = new UserComment (entry.Data, entry.ByteOrder == Exif.ByteOrder.Intel); - return comment.Value; + } } } Index: src/MainWindow.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/MainWindow.cs,v retrieving revision 1.286.2.6 diff -u -p -r1.286.2.6 MainWindow.cs --- src/MainWindow.cs 2 Jun 2006 20:46:02 -0000 1.286.2.6 +++ src/MainWindow.cs 9 Jun 2006 22:12:16 -0000 @@ -300,7 +300,7 @@ public class MainWindow { icon_view.DragDataGet += HandleIconViewDragDataGet; TagMenu menu = new TagMenu (attach_tag, db.Tags); - menu.NewTagHandler = HandleCreateTagAndAttach; + menu.NewTagHandler += delegate { HandleCreateTagAndAttach (main_window, null); }; menu.TagSelected += HandleAttachTagMenuSelected; near_image.SetFromStock ("f-spot-stock_near", IconSize.SmallToolbar); @@ -1579,7 +1579,7 @@ public class MainWindow { { PhotoVersionCommands.Create cmd = new PhotoVersionCommands.Create (); - if (cmd.Execute (db.Photos, CurrentPhoto, main_window)) { + if (cmd.Execute (db.Photos, CurrentPhoto, GetToplevel (null))) { query.MarkChanged (ActiveIndex ()); } } @@ -1588,7 +1588,7 @@ public class MainWindow { { PhotoVersionCommands.Delete cmd = new PhotoVersionCommands.Delete (); - if (cmd.Execute (db.Photos, CurrentPhoto, main_window)) { + if (cmd.Execute (db.Photos, CurrentPhoto, GetToplevel (null))) { query.MarkChanged (ActiveIndex ()); } } @@ -1619,7 +1619,7 @@ public class MainWindow { public void HandleCreateTagAndAttach (object sender, EventArgs args) { - Tag new_tag = CreateTag (); + Tag new_tag = CreateTag (sender, args); if (new_tag != null) HandleAttachTagMenuSelected (new_tag); @@ -1627,7 +1627,7 @@ public class MainWindow { public void HandleCreateNewCategoryCommand (object sender, EventArgs args) { - Tag new_tag = CreateTag (); + Tag new_tag = CreateTag (sender, args); if (new_tag != null) { tag_selection_widget.ScrollTo (new_tag); @@ -1635,9 +1635,9 @@ public class MainWindow { } } - public Tag CreateTag () + public Tag CreateTag (object sender, EventArgs args) { - TagCommands.Create command = new TagCommands.Create (db.Tags, main_window); + TagCommands.Create command = new TagCommands.Create (db.Tags, GetToplevel (sender)); return command.Execute (TagCommands.TagType.Category, tag_selection_widget.TagHighlight); } @@ -2081,7 +2081,7 @@ public class MainWindow { return toplevel; } - + public void HandleDeleteCommand (object sender, EventArgs args) { Photo[] photos = SelectedPhotos(); @@ -2533,7 +2533,7 @@ public class MainWindow { } } - public void HandleOpenWith (Gnome.Vfs.MimeApplication mime_application) + public void HandleOpenWith (object sender, Gnome.Vfs.MimeApplication mime_application) { Photo[] selected = SelectedPhotos (); @@ -2547,7 +2547,7 @@ public class MainWindow { selected.Length, mime_application.Name); // FIXME add cancel button? add help button? - HigMessageDialog hmd = new HigMessageDialog(main_window, DialogFlags.DestroyWithParent, + HigMessageDialog hmd = new HigMessageDialog(GetToplevel (sender), DialogFlags.DestroyWithParent, MessageType.Question, Gtk.ButtonsType.None, header, msg); @@ -2568,17 +2568,28 @@ public class MainWindow { bool create_new_versions = (response == Gtk.ResponseType.Yes); + ArrayList errors = new ArrayList (); GLib.List uri_list = new GLib.List (typeof (string)); foreach (Photo photo in selected) { - if (create_new_versions) { - // FIXME exception handling? Out of space, blah, blah - uint version = photo.CreateNamedVersion (mime_application.Name, photo.DefaultVersionId, true); - photo.DefaultVersionId = version; - } + // FIXME need to clean up the error dialog here. + try { + if (create_new_versions) { + uint version = photo.CreateNamedVersion (mime_application.Name, photo.DefaultVersionId, true); + photo.DefaultVersionId = version; + } - uri_list.Append (photo.DefaultVersionPath); + uri_list.Append (photo.DefaultVersionPath); + } catch (Exception e) { + errors.Add (new EditException (photo, e)); + } } + if (errors.Count > 0) { + Dialog md = new EditExceptionDialog (GetToplevel (sender), errors.ToArray (typeof (EditException)) as EditException []); + md.Run (); + md.Destroy (); + } + if (create_new_versions) { db.Photos.Commit (selected, new DbItemEventArgs (selected)); } Index: src/PhotoPopup.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/PhotoPopup.cs,v retrieving revision 1.13.2.1 diff -u -p -r1.13.2.1 PhotoPopup.cs --- src/PhotoPopup.cs 2 Jun 2006 20:12:44 -0000 1.13.2.1 +++ src/PhotoPopup.cs 9 Jun 2006 22:12:16 -0000 @@ -57,7 +57,7 @@ public class PhotoPopup { OpenWithMenu owm = OpenWithMenu.AppendMenuTo (popup_menu, MainWindow.Toplevel.SelectedMimeTypes); owm.IgnoreApp = "f-spot"; - owm.ApplicationActivated += MainWindow.Toplevel.HandleOpenWith; + owm.ApplicationActivated += delegate (Gnome.Vfs.MimeApplication app) { MainWindow.Toplevel.HandleOpenWith (creator, app); }; GtkUtil.MakeMenuItem (popup_menu, Mono.Posix.Catalog.GetString ("Remove From Catalog"), delegate { MainWindow.Toplevel.HandleRemoveCommand (creator, null); }, have_selection); @@ -71,7 +71,7 @@ public class PhotoPopup { // MenuItem attach_item = new MenuItem (Mono.Posix.Catalog.GetString ("Attach Tag")); TagMenu attach_menu = new TagMenu (attach_item, MainWindow.Toplevel.Database.Tags); - attach_menu.NewTagHandler = MainWindow.Toplevel.HandleCreateTagAndAttach; + attach_menu.NewTagHandler += delegate { MainWindow.Toplevel.HandleCreateTagAndAttach (creator, null); }; attach_menu.TagSelected += MainWindow.Toplevel.HandleAttachTagMenuSelected; attach_item.ShowAll (); popup_menu.Append (attach_item); Index: src/PhotoView.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/PhotoView.cs,v retrieving revision 1.84.2.3 diff -u -p -r1.84.2.3 PhotoView.cs --- src/PhotoView.cs 2 Jun 2006 20:13:43 -0000 1.84.2.3 +++ src/PhotoView.cs 9 Jun 2006 22:12:16 -0000 @@ -3,7 +3,7 @@ using GLib; using Gtk; using GtkSharp; using System; -using Mono.Posix; +using Mono.Unix; using FSpot.Xmp; public class PhotoView : EventBox { @@ -272,16 +272,9 @@ public class PhotoView : EventBox { ProcessImage (false); } - private void ShowError (System.Exception e, Photo photo) + private void ShowError (System.Exception e, FSpot.IBrowsableItem photo) { - string msg = Mono.Posix.Catalog.GetString ("Error editing photo"); - string desc = String.Format (Mono.Posix.Catalog.GetString ("Received exception \"{0}\". Unable to save photo {1}"), - e.Message, photo.Name); - - HigMessageDialog md = new HigMessageDialog ((Gtk.Window)this.Toplevel, DialogFlags.DestroyWithParent, - Gtk.MessageType.Error, ButtonsType.Ok, - msg, - desc); + Dialog md = new FSpot.EditExceptionDialog ((Gtk.Window)this.Toplevel, e, photo); md.Run (); md.Destroy (); } Index: src/Tiff.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/Tiff.cs,v retrieving revision 1.69.2.1 diff -u -p -r1.69.2.1 Tiff.cs --- src/Tiff.cs 5 Jun 2006 18:11:59 -0000 1.69.2.1 +++ src/Tiff.cs 9 Jun 2006 22:12:17 -0000 @@ -357,7 +357,7 @@ namespace FSpot.Tiff { public UserComment (byte [] raw_data, bool little) { - if (raw_data.Length == 8) { + if (raw_data.Length == 8 || raw_data.Length == 0) { Charset = null; Value = ""; return; Index: src/main.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/main.cs,v retrieving revision 1.29.2.1 diff -u -p -r1.29.2.1 main.cs --- src/main.cs 9 May 2006 22:56:24 -0000 1.29.2.1 +++ src/main.cs 9 Jun 2006 22:12:17 -0000 @@ -4,6 +4,7 @@ using System; using System.IO; using System.Runtime.InteropServices; using System.Text; +using Mono.Unix; @@ -24,6 +25,8 @@ public class Driver { try { foreach (string arg in args) { if (arg == "--help") { + Catalog.Init ("f-spot", Defines.LOCALE_DIR); + System.Console.WriteLine ("Usage f-spot [OPTION. ..]\n"); System.Console.WriteLine (" --import [uri]\t\t\timport from the given uri"); System.Console.WriteLine (" --view <file>\t\t\t\tview a file or directory "); @@ -38,6 +41,8 @@ public class Driver { Modules.UI, args); return; } else if (arg == "--slideshow") { + Catalog.Init ("f-spot", Defines.LOCALE_DIR); + program = new Program (Defines.PACKAGE, Defines.VERSION, Modules.UI, args); @@ -75,12 +80,11 @@ public class Driver { Gnome.Vfs.Vfs.Initialize (); StockIcons.Initialize (); - Mono.Posix.Catalog.Init ("f-spot", Defines.LOCALE_DIR); + Catalog.Init ("f-spot", Defines.LOCALE_DIR); + Gtk.Window.DefaultIconList = new Gdk.Pixbuf [] {PixbufUtils.LoadFromAssembly ("f-spot-logo.png")}; core = new Core (); core.RegisterServer (); - - Gtk.Window.DefaultIconList = new Gdk.Pixbuf [] {PixbufUtils.LoadFromAssembly ("f-spot-logo.png")}; // FIXME: Error checking is non-existant here... ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org