[gnome-builder] GbEditorDocument: save ctime for unsaved ctime
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] GbEditorDocument: save ctime for unsaved ctime
- Date: Sat, 13 Dec 2014 01:48:54 +0000 (UTC)
commit f22f32cc0bc307fcd4fcb0e81f200d2bc9676bfa
Author: Christian Hergert <christian hergert me>
Date: Fri Dec 12 17:48:45 2014 -0800
GbEditorDocument: save ctime for unsaved ctime
src/editor/gb-editor-document.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 59a05a3..5ce984d 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -42,6 +42,7 @@ struct _GbEditorDocumentPrivate
gdouble progress;
guint doc_seq_id;
GTimeVal mtime;
+ GTimeVal unsaved_ctime;
guint file_changed_on_volume : 1;
guint mtime_set : 1;
@@ -677,7 +678,10 @@ gb_editor_document_notify_file_location (GbEditorDocument *document,
if (!location)
{
if (!priv->doc_seq_id)
- priv->doc_seq_id = gb_doc_seq_acquire ();
+ {
+ priv->doc_seq_id = gb_doc_seq_acquire ();
+ g_get_current_time (&priv->unsaved_ctime);
+ }
}
else
{
@@ -1139,6 +1143,12 @@ gb_editor_document_get_mtime (GbDocument *document,
g_return_val_if_fail (GB_IS_EDITOR_DOCUMENT (self), FALSE);
+ if (self->priv->doc_seq_id)
+ {
+ memcpy (mtime, &self->priv->unsaved_ctime, sizeof *mtime);
+ return TRUE;
+ }
+
if (self->priv->mtime_set)
{
memcpy (mtime, &self->priv->mtime, sizeof *mtime);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]