[gnome-builder/gnome-builder-3-20] context: allow projects in .local



commit ab34b90e40db5e80ad77cc57562c8b691d5d72c9
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 13:21:37 2016 +0300

    context: allow projects in .local
    
    We often get bug reports on irc/bugzilla about created projects being
    ignored. It is usually related to creating gnome-shell extensions in the
    location that gnome-shell reads them from.
    
    Might as well just allow creating projects in .local.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764190

 libide/ide-context.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-context.c b/libide/ide-context.c
index ecaf786..70812f6 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -1283,7 +1283,16 @@ directory_is_ignored (GFile *file)
   if (g_file_equal (file, downloads_prefix) || g_file_has_prefix (file, downloads_prefix))
     return TRUE;
 
-  if (g_str_has_prefix (relative_path, "."))
+  /* realtive_path should be valid here because we are within the home_prefix. */
+  g_assert (relative_path != NULL);
+
+  /*
+   * Ignore dot directories, except .local.
+   * We've had too many bug reports with people creating things
+   * like gnome-shell extensions in their .local directory.
+   */
+  if (*relative_path == '.' &&
+      !g_str_has_prefix (relative_path, ".local"G_DIR_SEPARATOR_S))
     return TRUE;
 
   if (type != G_FILE_TYPE_DIRECTORY)


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