From ccd03fb15b68c50c6d6a19c0568f6f20626cdf1c Mon Sep 17 00:00:00 2001
From: Mikolaj Wielgus <wielgusmikolaj@gmail.com>
Date: Sun, 17 Nov 2019 16:13:05 +0100
Subject: [PATCH] Recurse into dirs added via fs watcher handlers
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.24.0"

This is a multi-part message in MIME format.
--------------2.24.0
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


Recurse into directories, added via the filesystem watcher event
handlers, to populate them and mark as populated; without the latter,
subsequently created or renamed files within these directories won't
become added to the file manager tree hierarchy.

Fixes: lp:1852904
---
 kicad/tree_project_frame.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


--------------2.24.0
Content-Type: text/x-patch; name="0001-Recurse-into-dirs-added-via-fs-watcher-handlers.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Recurse-into-dirs-added-via-fs-watcher-handlers.patch"

diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp
index 5a01659f5..31945f6b2 100644
--- a/kicad/tree_project_frame.cpp
+++ b/kicad/tree_project_frame.cpp
@@ -876,7 +876,7 @@ void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event )
     {
     case wxFSW_EVENT_CREATE:
         {
-            wxTreeItemId newitem = AddItemToTreeProject( pathModified.GetFullPath(), root_id, false );
+            wxTreeItemId newitem = AddItemToTreeProject( pathModified.GetFullPath(), root_id );
 
             // If we are in the process of renaming a file, select the new one
             // This is needed for MSW and OSX, since we don't get RENAME events from them, just a
@@ -923,7 +923,7 @@ void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event )
             }
 
             wxTreeItemId newroot_id = findSubdirTreeItem( newdir );
-            wxTreeItemId newitem = AddItemToTreeProject( newfn, newroot_id, false );
+            wxTreeItemId newitem = AddItemToTreeProject( newfn, newroot_id );
 
             // If the item exists, select it
             if( newitem.IsOk() )

--------------2.24.0--


