[f-spot] maxxer patches were better
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot] maxxer patches were better
- Date: Tue, 15 Sep 2009 14:00:01 +0000 (UTC)
commit 29462807f8a632d46269259dd162504c20997655
Author: Stephane Delcroix <stephane delcroix org>
Date: Tue Sep 15 15:57:13 2009 +0200
maxxer patches were better
src/Imaging/ImageFile.cs | 9 ++++-----
src/ThumbnailGenerator.cs | 7 +++----
2 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index e0e0ee2..0cb97ba 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -4,9 +4,9 @@ using System.Collections;
using FSpot.Utils;
using Mono.Unix;
+using Mono.Unix.Native;
using Gdk;
-using GFile = GLib.File;
using GFileInfo = GLib.FileInfo;
namespace FSpot {
@@ -170,10 +170,9 @@ namespace FSpot {
get {
// FIXME mono uses the file change time (ctime) incorrectly
// as the creation time so we try to work around that slightly
- GFile file = GLib.FileFactory.NewForUri (uri);
- GFileInfo file_info = file.QueryInfo ("time::*", GLib.FileQueryInfoFlags.None, null);
- DateTime create = file_info.CreationTime;
- DateTime write = file_info.ModificationTime;
+ GFileInfo info = GLib.FileFactory.NewForUri (uri).QueryInfo ("time::modified,time::created", GLib.FileQueryInfoFlags.None, null);
+ DateTime write = NativeConvert.ToDateTime ((long)info.GetAttributeULong ("time::modified"));
+ DateTime create = NativeConvert.ToDateTime ((long)info.GetAttributeULong ("time::created"));
if (create < write)
return create;
diff --git a/src/ThumbnailGenerator.cs b/src/ThumbnailGenerator.cs
index 0ef6be7..ae4d408 100644
--- a/src/ThumbnailGenerator.cs
+++ b/src/ThumbnailGenerator.cs
@@ -12,7 +12,7 @@ using System.IO;
using FSpot.Utils;
using FSpot.Platform;
-using GFile = GLib.File;
+using Mono.Unix.Native;
using GFileInfo = GLib.FileInfo;
namespace FSpot {
@@ -38,9 +38,8 @@ namespace FSpot {
return null;
try { //Setting the thumb options
- GFile file = GLib.FileFactory.NewForUri (uri);
- GFileInfo file_info = file.QueryInfo ("time::modified", GLib.FileQueryInfoFlags.None, null);
- DateTime mtime = file_info.ModificationTime;
+ GFileInfo info = GLib.FileFactory.NewForUri (uri).QueryInfo ("time::modified", GLib.FileQueryInfoFlags.None, null);
+ DateTime mtime = NativeConvert.ToDateTime ((long)info.GetAttributeULong ("time::modified"));
FSpot.Utils.PixbufUtils.SetOption (thumb, ThumbUri, UriUtils.UriToStringEscaped (uri));
FSpot.Utils.PixbufUtils.SetOption (thumb, ThumbMTime, ((uint)GLib.Marshaller.DateTimeTotime_t (mtime)).ToString ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]