From 8495d429ffb50f15ad351ed9b9e2a611e8282d79 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 10 Sep 2018 10:54:54 +0100 Subject: [PATCH] Projucer: Removed the jobNeedsRunningAgain logic from AvailableModuleList's ModuleScannerJob as it was causing the job to hang when the module was found in the root directory --- .../Projucer/Source/Project/jucer_Module.cpp | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/extras/Projucer/Source/Project/jucer_Module.cpp b/extras/Projucer/Source/Project/jucer_Module.cpp index 201221d855..853b51a2ec 100644 --- a/extras/Projucer/Source/Project/jucer_Module.cpp +++ b/extras/Projucer/Source/Project/jucer_Module.cpp @@ -125,7 +125,7 @@ static bool tryToAddModuleFromFolder (const File& path, ModuleIDAndFolderList& l return false; } -static bool addAllModulesInSubfoldersRecursively (const File& path, int depth, ModuleIDAndFolderList& list) +static void addAllModulesInSubfoldersRecursively (const File& path, int depth, ModuleIDAndFolderList& list) { if (depth > 0) { @@ -133,30 +133,23 @@ static bool addAllModulesInSubfoldersRecursively (const File& path, int depth, M { if (auto* job = ThreadPoolJob::getCurrentThreadPoolJob()) if (job->shouldExit()) - return false; + return; auto childPath = iter.getFile().getLinkedTarget(); if (! tryToAddModuleFromFolder (childPath, list)) - if (! addAllModulesInSubfoldersRecursively (childPath, depth - 1, list)) - return false; + addAllModulesInSubfoldersRecursively (childPath, depth - 1, list); } } - - return true; } -static bool addAllModulesInFolder (const File& path, ModuleIDAndFolderList& list) +static void addAllModulesInFolder (const File& path, ModuleIDAndFolderList& list) { - bool exitedBeforeCompletion = false; - if (! tryToAddModuleFromFolder (path, list)) { int subfolders = 3; - exitedBeforeCompletion = addAllModulesInSubfoldersRecursively (path, subfolders, list); + addAllModulesInSubfoldersRecursively (path, subfolders, list); } - - return exitedBeforeCompletion; } static void sort (ModuleIDAndFolderList& listToSort) @@ -182,11 +175,13 @@ struct ModuleScannerJob : public ThreadPoolJob ModuleIDAndFolderList list; for (auto& p : pathsToScan) - if (! addAllModulesInFolder (p, list)) - return jobNeedsRunningAgain; + addAllModulesInFolder (p, list); - sort (list); - completionCallback (list); + if (! shouldExit()) + { + sort (list); + completionCallback (list); + } return jobHasFinished; }