[geany/geany] 3495cf: Remove saved file's mtime check comparing it with the current time
Jiří Techet
git-noreply at xxxxx
Tue Oct 6 13:16:42 UTC 2015
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Tue, 18 Aug 2015 17:48:12 UTC
Commit: 3495cf05abf42e5f08952a19d3798cc27a50b6e6
https://github.com/geany/geany/commit/3495cf05abf42e5f08952a19d3798cc27a50b6e6
Log Message:
-----------
Remove saved file's mtime check comparing it with the current time
As the edited file can be a remote file on a server with a different time
zone, the mtime can actually be in the future. In this case the check not
only shows the misleading warning but more importantly the
doc->priv->mtime < st.st_mtime
check never happens and the user doesn't get the modified file prompt.
Setting
doc->priv->mtime = time(NULL);
to the current time on file creation isn't harmful in any way because the
saved file's mtime is taken but it's a bit misleading so better to set it
to 0.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
8 lines changed, 1 insertions(+), 7 deletions(-)
===================================================================
@@ -885,7 +885,7 @@ GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft,
#ifdef USE_GIO_FILEMON
monitor_file_setup(doc);
#else
- doc->priv->mtime = time(NULL);
+ doc->priv->mtime = 0;
#endif
/* "the" SCI signal (connect after initial setup(i.e. adding text)) */
@@ -3617,12 +3617,6 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
/* doc may be closed now */
ret = TRUE;
}
- else if (! use_gio_filemon && /* ignore check when using GIO */
- doc->priv->mtime > cur_time)
- {
- g_warning("%s: Something is wrong with the time stamps.", G_STRFUNC);
- /* Note: on Windows st.st_mtime can be newer than cur_time */
- }
else if (doc->priv->mtime < st.st_mtime)
{
/* make sure the user is not prompted again after he cancelled the "reload file?" message */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list