f-spot r3899 - trunk/extensions/CDExport
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r3899 - trunk/extensions/CDExport
- Date: Fri, 9 May 2008 21:34:43 +0100 (BST)
Author: sdelcroix
Date: Fri May 9 20:34:43 2008
New Revision: 3899
URL: http://svn.gnome.org/viewvc/f-spot?rev=3899&view=rev
Log:
CDExport should be ok now, need tests
Modified:
trunk/extensions/CDExport/CDExport.addin.xml
trunk/extensions/CDExport/CDExport.cs
Modified: trunk/extensions/CDExport/CDExport.addin.xml
==============================================================================
--- trunk/extensions/CDExport/CDExport.addin.xml (original)
+++ trunk/extensions/CDExport/CDExport.addin.xml Fri May 9 20:34:43 2008
@@ -1,5 +1,5 @@
<Addin namespace="FSpot"
- version="0.4.3.2"
+ version="0.4.3.3"
name="CD Export"
description="This extension allows you to burn your photos to CD."
author="F-Spot team"
Modified: trunk/extensions/CDExport/CDExport.cs
==============================================================================
--- trunk/extensions/CDExport/CDExport.cs (original)
+++ trunk/extensions/CDExport/CDExport.cs Fri May 9 20:34:43 2008
@@ -100,12 +100,7 @@
Gnome.Vfs.Uri target = path.Clone();
Gnome.Vfs.Uri dest = target.AppendFileName(shortname);
#endif
-#if GIO_2_16
- while (dest.QueryExists (null)) {
-#else
while (dest.Exists) {
-#endif
-
string numbered_name = System.String.Format ("{0}-{1}{2}",
System.IO.Path.GetFileNameWithoutExtension (shortname),
i++,
@@ -121,16 +116,24 @@
return dest;
}
- void Clean ()
- {
#if GIO_2_16
-
+ void Clean (System.Uri path)
+ {
+ GLib.File source = FileFactory.NewForUri (path);
+ foreach (GLib.FileInfo info in source.EnumerateChildren ("*", FileQueryInfoFlags.None, null)) {
+ if (info.FileType == FileType.Directory)
+ Clean (new System.Uri(path, info.Name));
+ FileFactory.NewForUri (new System.Uri (path, info.Name));
+ }
+ }
#else
+ void Clean ()
+ {
Gnome.Vfs.Uri target = dest.Clone ();
Gnome.Vfs.XferProgressCallback cb = new Gnome.Vfs.XferProgressCallback (Progress);
Gnome.Vfs.Xfer.XferDeleteList (new Gnome.Vfs.Uri [] {target}, Gnome.Vfs.XferErrorMode.Query, Gnome.Vfs.XferOptions.Recursive, cb);
-#endif
}
+#endif
public void Transfer () {
try {
@@ -141,7 +144,11 @@
#endif
if (clean)
+#if GIO_2_16
+ Clean (dest);
+#else
Clean ();
+#endif
foreach (IBrowsableItem photo in selection.Items) {
@@ -159,7 +166,6 @@
#if GIO_2_16
GLib.File target = UniqueName (dest, photo.Name);
FileProgressCallback cb = Progress;
- Console.WriteLine ("source {0}, dest {1}", source, target);
#else
target = UniqueName (target, photo.Name);
Gnome.Vfs.XferProgressCallback cb = new Gnome.Vfs.XferProgressCallback (Progress);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]