[f-spot] Minor fixes to ZipExport
- From: Lorenzo Milesi <lmilesi src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] Minor fixes to ZipExport
- Date: Thu, 2 Jul 2009 07:18:19 +0000 (UTC)
commit 72e022b6e318822efbb7ce8202565c8b6640572b
Author: Lorenzo Milesi <maxxer yetopen it>
Date: Thu Jul 2 09:16:48 2009 +0200
Minor fixes to ZipExport
Removed S.C.WL, ensured proper filename creation.
extensions/Exporters/ZipExport/ZipExport.addin.xml | 2 +-
extensions/Exporters/ZipExport/ZipExport.cs | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/extensions/Exporters/ZipExport/ZipExport.addin.xml b/extensions/Exporters/ZipExport/ZipExport.addin.xml
index b267a35..2de5007 100644
--- a/extensions/Exporters/ZipExport/ZipExport.addin.xml
+++ b/extensions/Exporters/ZipExport/ZipExport.addin.xml
@@ -1,6 +1,6 @@
<Addin namespace="FSpot"
id="ZipExport"
- version="0.6"
+ version="0.6.0.1"
name="Zip export"
description="Simple export to Zip file"
author="Lorenzo Milesi"
diff --git a/extensions/Exporters/ZipExport/ZipExport.cs b/extensions/Exporters/ZipExport/ZipExport.cs
index 0be96ba..8828ee3 100644
--- a/extensions/Exporters/ZipExport/ZipExport.cs
+++ b/extensions/Exporters/ZipExport/ZipExport.cs
@@ -16,6 +16,7 @@ using FSpot;
using FSpot.UI.Dialog;
using FSpot.Extensions;
using FSpot.Filters;
+using FSpot.Utils;
using System;
using System.IO;
using System.Collections;
@@ -39,7 +40,7 @@ namespace ZipExport {
Gtk.FileChooserButton uri_chooser;
public void Run (IBrowsableCollection p) {
- Console.WriteLine ("Executing ZipExport extension");
+ Log.Information ("Executing ZipExport extension");
if (p.Count == 0) {
HigMessageDialog md = new HigMessageDialog (MainWindow.Toplevel.Window, DialogFlags.DestroyWithParent,
Gtk.MessageType.Error, ButtonsType.Ok,
@@ -93,10 +94,10 @@ namespace ZipExport {
Gnome.Vfs.Uri dest = new Gnome.Vfs.Uri (uri_chooser.Uri);
Crc32 crc = new Crc32 ();
string filedest = Gnome.Vfs.Uri.GetLocalPathFromUri (dest.ToString ()) + "/" + filename.Text;
- Console.WriteLine ("Creating zip file {0}", filedest);
+ Log.Debug ("Creating zip file {0}", filedest);
ZipOutputStream s = new ZipOutputStream (File.Create(filedest));
if (scale_check.Active)
- Console.WriteLine ("Scaling to {0}", scale_size.ValueAsInt);
+ Log.Debug ("Scaling to {0}", scale_size.ValueAsInt);
ProgressDialog progress_dialog = new ProgressDialog (Catalog.GetString ("Exporting files"),
ProgressDialog.CancelButtonType.Stop,
@@ -109,6 +110,7 @@ namespace ZipExport {
return;
}
string f = null;
+ // FIXME: embed in a try/catch
if (scale_check.Active) {
FilterSet filters = new FilterSet ();
filters.Add (new JpegFilter ());
@@ -123,7 +125,7 @@ namespace ZipExport {
byte [] buffer = new byte [fs.Length];
fs.Read (buffer, 0, buffer.Length);
- ZipEntry entry = new ZipEntry (photos [i].Name);
+ ZipEntry entry = new ZipEntry (System.IO.Path.GetFileName (photos [i].DefaultVersionUri.LocalPath));
entry.DateTime = DateTime.Now;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]