Force a file changed check when attempting to open an already open

file.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1119 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-12-18 13:04:18 +00:00
parent 219dd8c728
commit 055f70da67
6 changed files with 12 additions and 5 deletions

View File

@ -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>

View File

@ -733,7 +733,7 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
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);

View File

@ -584,6 +584,7 @@ int document_open_file(gint idx, const gchar *filename, gint pos, gboolean reado
(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;
}
}

View File

@ -66,7 +66,7 @@ on_editor_button_press_event (GtkWidget *widget,
if (event->button == 1)
{
return utils_check_disk_status(idx);
return utils_check_disk_status(idx, FALSE);
}
if (event->button == 3)

View File

@ -324,7 +324,9 @@ gchar *utils_find_open_xml_tag(const gchar sel[], gint size, gboolean check_tag)
}
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 @@ gboolean utils_check_disk_status(gint idx)
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)

View File

@ -49,7 +49,7 @@ gint utils_write_file(const gchar *filename, const gchar *text);
*/
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);