Revision: 1119 http://svn.sourceforge.net/geany/?rev=1119&view=rev Author: ntrel Date: 2006-12-18 05:04:18 -0800 (Mon, 18 Dec 2006)
Log Message: ----------- Force a file changed check when attempting to open an already open file.
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/document.c trunk/src/sci_cb.c trunk/src/utils.c trunk/src/utils.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/ChangeLog 2006-12-18 13:04:18 UTC (rev 1119) @@ -11,6 +11,10 @@ * src/document.c: Don't set the cursor to the start of the document when attempting to open an already open file. + * src/utils.c, src/utils.h, src/callbacks.c, src/sci_cb.c, + src/document.c: + Force a file changed check when attempting to open an already open + file.
2006-12-17 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/src/callbacks.c 2006-12-18 13:04:18 UTC (rev 1119) @@ -733,7 +733,7 @@
if (idx >= 0 && app->opening_session_files == FALSE) { - utils_check_disk_status(idx); + utils_check_disk_status(idx, FALSE);
#ifdef HAVE_VTE vte_cwd(doc_list[idx].file_name, FALSE);
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/src/document.c 2006-12-18 13:04:18 UTC (rev 1119) @@ -584,6 +584,7 @@ (GtkWidget*) doc_list[idx].sci)); g_free(utf8_filename); g_free(locale_filename); + utils_check_disk_status(idx, TRUE); // force a file changed check return idx; } }
Modified: trunk/src/sci_cb.c =================================================================== --- trunk/src/sci_cb.c 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/src/sci_cb.c 2006-12-18 13:04:18 UTC (rev 1119) @@ -66,7 +66,7 @@
if (event->button == 1) { - return utils_check_disk_status(idx); + return utils_check_disk_status(idx, FALSE); }
if (event->button == 3)
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/src/utils.c 2006-12-18 13:04:18 UTC (rev 1119) @@ -324,7 +324,9 @@ }
-gboolean utils_check_disk_status(gint idx) +/* Set force to force a disk check, otherwise it is ignored if there was a check + * in the last GEANY_CHECK_FILE_DELAY seconds. */ +gboolean utils_check_disk_status(gint idx, gboolean force) { struct stat st; time_t t; @@ -335,7 +337,7 @@
t = time(NULL);
- if (doc_list[idx].last_check > (t - GEANY_CHECK_FILE_DELAY)) return FALSE; + if (! force && doc_list[idx].last_check > (t - GEANY_CHECK_FILE_DELAY)) return FALSE;
locale_filename = utils_get_locale_from_utf8(doc_list[idx].file_name); if (stat(locale_filename, &st) != 0)
Modified: trunk/src/utils.h =================================================================== --- trunk/src/utils.h 2006-12-18 12:46:35 UTC (rev 1118) +++ trunk/src/utils.h 2006-12-18 13:04:18 UTC (rev 1119) @@ -49,7 +49,7 @@ */ gchar *utils_find_open_xml_tag(const gchar sel[], gint size, gboolean check_tag);
-gboolean utils_check_disk_status(gint idx); +gboolean utils_check_disk_status(gint idx, gboolean force);
//gchar *utils_get_current_tag(gint idx, gint direction); gint utils_get_current_function(gint idx, const gchar **tagname);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.