[f-spot/FSPOT_0_6_0_STABLE] Check for existing files on version creation
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot/FSPOT_0_6_0_STABLE] Check for existing files on version creation
- Date: Wed, 23 Sep 2009 14:15:29 +0000 (UTC)
commit a59bcdf44219ae797398c3a6cb479f656f84e129
Author: Stephane Delcroix <stephane delcroix org>
Date: Wed Sep 23 16:13:56 2009 +0200
Check for existing files on version creation
this fixes bgo #596071
src/Core/Photo.cs | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Photo.cs b/src/Core/Photo.cs
index adf5f8d..7b48724 100644
--- a/src/Core/Photo.cs
+++ b/src/Core/Photo.cs
@@ -493,8 +493,11 @@ namespace FSpot
"Modified ({0})",
num);
name = String.Format (name, num);
+ System.Uri uri = GetUriForVersionName (name, System.IO.Path.GetExtension (VersionUri(base_version_id).GetFilename()));
+Console.WriteLine ("NEW VERSION URI {0}", uri);
+ GLib.File file = GLib.FileFactory.NewForUri (uri);
- if (! VersionNameExists (name))
+ if (! VersionNameExists (name) && ! file.Exists)
return CreateVersion (name, base_version_id, create_file);
num ++;
@@ -516,7 +519,11 @@ namespace FSpot
(num == 1) ? Catalog.GetString ("Modified in {1}") : Catalog.GetString ("Modified in {1} ({0})"),
num, name);
- if (! VersionNameExists (final_name))
+ System.Uri uri = GetUriForVersionName (final_name, System.IO.Path.GetExtension (VersionUri(base_version_id).GetFilename()));
+Console.WriteLine ("NEW VERSION URI {0}", uri);
+ GLib.File file = GLib.FileFactory.NewForUri (uri);
+
+ if (! VersionNameExists (final_name) && ! file.Exists)
return CreateVersion (final_name, extension, base_version_id, create_file);
num ++;
@@ -531,8 +538,8 @@ namespace FSpot
if (VersionNameExists (new_name))
throw new Exception ("This name already exists");
- (GetVersion (version_id) as PhotoVersion).Name = new_name;
+ (GetVersion (version_id) as PhotoVersion).Name = new_name;
changes.ChangeVersion (version_id);
//TODO: rename file too ???
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]