From f5edc6424b6553d58e271f64471cef32e063dd19 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Wed, 8 Oct 2008 19:21:28 -0300 Subject: Rewrite double click confirmation code. Remove the double_click global boolean, and change dc_state to a bit field, instead of a single state variable. The old code was the xedit original code with minimal changes, but was a bit confusing when two confirmations would be required. Also, this patch moves the check for file overwriting before MaybeCreateFile() as it can actually call creat(), what means that it can no longer ask for confirmations, as the file has been just backed up, and a zero sized one created. --- xedit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xedit.c') diff --git a/xedit.c b/xedit.c index 7917d23..0b49226 100644 --- a/xedit.c +++ b/xedit.c @@ -279,8 +279,10 @@ main(int argc, char *argv[]) flags, file_access); XtAddCallback(item->source, XtNcallback, SourceChanged, (XtPointer)item); - if (exists && file_access == WRITE_OK) + if (exists && file_access == WRITE_OK) { item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + item->mtime = st.st_mtime; + } if (!num_loaded) SwitchTextSource(item); ++num_loaded; -- cgit v1.2.3