[anjuta/gnome-3-18] sourceview: bgo #756426 - Anjuta show "The file ... has been deleted on the disk" everytime I save f



commit 22ec0c212900d68e621cdf14281aa164a003d20a
Author: Yannick Inizan <inizan yannick gmail com>
Date:   Sun Oct 25 14:45:32 2015 +0100

    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 files changed, 11 insertions(+), 1 deletions(-)
---
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;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]