SF.net SVN: geany: [2650] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Fri Jun 6 12:31:06 UTC 2008
Revision: 2650
http://geany.svn.sourceforge.net/geany/?rev=2650&view=rev
Author: ntrel
Date: 2008-06-06 05:31:05 -0700 (Fri, 06 Jun 2008)
Log Message:
-----------
Check that the current file is still on disk as well as checking the
modification time.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-05 16:52:39 UTC (rev 2649)
+++ trunk/ChangeLog 2008-06-06 12:31:05 UTC (rev 2650)
@@ -1,3 +1,10 @@
+2008-06-06 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/utils.c:
+ Check that the current file is still on disk as well as checking the
+ modification time.
+
+
2008-06-05 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* Makefile.am, waf, wscript, scripts/wafinit.sh:
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2008-06-05 16:52:39 UTC (rev 2649)
+++ trunk/src/utils.c 2008-06-06 12:31:05 UTC (rev 2650)
@@ -307,17 +307,30 @@
gboolean ret = FALSE;
if (file_prefs.disk_check_timeout == 0) return FALSE;
- if (idx == -1 || documents[idx]->file_name == NULL) return FALSE;
+ if (! DOC_IDX_VALID(idx)) return FALSE;
+ /* ignore documents that have never been saved to disk */
+ if (documents[idx]->real_path == NULL) return FALSE;
t = time(NULL);
if (! force && documents[idx]->last_check > (t - file_prefs.disk_check_timeout))
return FALSE;
+ documents[idx]->last_check = t;
+
locale_filename = utils_get_locale_from_utf8(documents[idx]->file_name);
if (g_stat(locale_filename, &st) != 0)
{
- /* TODO: warn user file on disk is missing */
+ /* file is missing - set unsaved state */
+ documents[idx]->changed = TRUE;
+ document_set_text_changed(idx);
+
+ if (dialogs_show_question_full(NULL, GTK_STOCK_SAVE, GTK_STOCK_CANCEL,
+ _("Try to resave the file?"),
+ _("File \"%s\" was not found on disk!"), documents[idx]->file_name))
+ {
+ dialogs_show_save_as();
+ }
}
else if (documents[idx]->mtime > t || st.st_mtime > t)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list