summaryrefslogtreecommitdiff
path: root/xedit.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-08 19:21:28 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-10-08 19:21:28 -0300
commitf5edc6424b6553d58e271f64471cef32e063dd19 (patch)
treefe5bfe4d26c5f6561b0d6f1484b8fd14cb745163 /xedit.c
parentd96491aad5542f052b722b94d86f0ce7661ae98b (diff)
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.
Diffstat (limited to 'xedit.c')
-rw-r--r--xedit.c4
1 files changed, 3 insertions, 1 deletions
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;