anjuta/anjuta-file-deleted-upon-save.patch
Bjørn Lie cecfb9f2af Accepting request 342874 from home:badshah400:branches:GNOME:Factory
Basically make anjuta usable again, by allowing saving instead of falsely warning about deleted files

OBS-URL: https://build.opensuse.org/request/show/342874
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/anjuta?expand=0&rev=187
2015-11-07 11:59:13 +00:00

38 lines
1.2 KiB
Diff

From e4b3dcce7086709c80cd159960f3a4433c054182 Mon Sep 17 00:00:00 2001
From: Yannick Inizan <inizan.yannick@gmail.com>
Date: Sun, 25 Oct 2015 14:45:32 +0100
Subject: sourceview: bgo #756426 - Anjuta show "The file ... has been deleted
on the disk" everytime I save file
SourceviewIO - Only emit "deleted" if monitored file isn't temporary.
---
plugins/sourceview/sourceview-io.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/plugins/sourceview/sourceview-io.c b/plugins/sourceview/sourceview-io.c
index ec93bc1..323e5d7 100644
--- a/plugins/sourceview/sourceview-io.c
+++ b/plugins/sourceview/sourceview-io.c
@@ -196,8 +196,18 @@ static void on_file_changed (GFileMonitor* monitor,
break;
}
case G_FILE_MONITOR_EVENT_DELETED:
- g_signal_emit_by_name (sio, "deleted");
+ {
+ gchar* filename = NULL;
+
+ if (G_IS_FILE (file))
+ filename = g_file_get_basename (file);
+ /* Only emit "deleted" if monitored file isn't temporary */
+ if (filename != NULL && !g_str_has_prefix (filename, ".goutputstream-"))
+ g_signal_emit_by_name (sio, "deleted");
+
+ g_free (filename);
break;
+ }
default:
break;
}
--
cgit v0.11.2