mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Added default module search paths to the Projucer
This commit is contained in:
parent
f1e98f54ed
commit
26596fbfad
41 changed files with 1624 additions and 928 deletions
|
|
@ -580,39 +580,3 @@ Project* MainWindowList::getFrontmostProject()
|
|||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
File findDefaultModulesFolder (bool mustContainJuceCoreModule)
|
||||
{
|
||||
auto& windows = ProjucerApplication::getApp().mainWindowList;
|
||||
|
||||
for (int i = windows.windows.size(); --i >= 0;)
|
||||
{
|
||||
if (auto* p = windows.windows.getUnchecked (i)->getProject())
|
||||
{
|
||||
const File f (EnabledModuleList::findDefaultModulesFolder (*p));
|
||||
|
||||
if (isJuceModulesFolder (f) || (f.isDirectory() && ! mustContainJuceCoreModule))
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
if (mustContainJuceCoreModule)
|
||||
return findDefaultModulesFolder (false);
|
||||
|
||||
auto f = File::getSpecialLocation (File::currentApplicationFile);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
auto parent = f.getParentDirectory();
|
||||
|
||||
if (parent == f || ! parent.isDirectory())
|
||||
break;
|
||||
|
||||
if (isJuceFolder (parent))
|
||||
return parent.getChildFile ("modules");
|
||||
|
||||
f = parent;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue