mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Remove getJUCEExamplesDirectoryPathFromGlobal() from jucer_MiscUtilities.h
This commit is contained in:
parent
563869300e
commit
dbaca088b3
5 changed files with 20 additions and 20 deletions
|
|
@ -605,7 +605,7 @@ void ProjucerApplication::createExamplesPopupMenu (PopupMenu& menu) noexcept
|
|||
}
|
||||
}
|
||||
|
||||
Array<File> ProjucerApplication::getSortedExampleDirectories() const noexcept
|
||||
Array<File> ProjucerApplication::getSortedExampleDirectories() noexcept
|
||||
{
|
||||
Array<File> exampleDirectories;
|
||||
|
||||
|
|
@ -662,6 +662,16 @@ bool ProjucerApplication::findWindowAndOpenPIP (const File& pip)
|
|||
return false;
|
||||
}
|
||||
|
||||
File ProjucerApplication::getJUCEExamplesDirectoryPathFromGlobal() noexcept
|
||||
{
|
||||
auto globalPath = getAppSettings().getStoredPath (Ids::jucePath).toString();
|
||||
|
||||
if (globalPath.isNotEmpty())
|
||||
return File (globalPath).getChildFile ("examples");
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void ProjucerApplication::findAndLaunchExample (int selectedIndex)
|
||||
{
|
||||
File example;
|
||||
|
|
@ -689,7 +699,7 @@ void ProjucerApplication::findAndLaunchExample (int selectedIndex)
|
|||
Analytics::getInstance()->logEvent ("Example Opened", data, ProjucerAnalyticsEvent::exampleEvent);
|
||||
}
|
||||
|
||||
File ProjucerApplication::findDemoRunnerExecutable() const noexcept
|
||||
File ProjucerApplication::findDemoRunnerExecutable() noexcept
|
||||
{
|
||||
auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds");
|
||||
|
||||
|
|
@ -751,7 +761,7 @@ File ProjucerApplication::findDemoRunnerExecutable() const noexcept
|
|||
return {};
|
||||
}
|
||||
|
||||
File ProjucerApplication::findDemoRunnerProject() const noexcept
|
||||
File ProjucerApplication::findDemoRunnerProject() noexcept
|
||||
{
|
||||
auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds");
|
||||
|
||||
|
|
|
|||
|
|
@ -177,14 +177,15 @@ private:
|
|||
void deleteTemporaryFiles() const noexcept;
|
||||
|
||||
void createExamplesPopupMenu (PopupMenu&) noexcept;
|
||||
Array<File> getSortedExampleDirectories() const noexcept;
|
||||
Array<File> getSortedExampleDirectories() noexcept;
|
||||
Array<File> getSortedExampleFilesInDirectory (const File&) const noexcept;
|
||||
|
||||
bool findWindowAndOpenPIP (const File&);
|
||||
|
||||
File getJUCEExamplesDirectoryPathFromGlobal() noexcept;
|
||||
void findAndLaunchExample (int);
|
||||
File findDemoRunnerExecutable() const noexcept;
|
||||
File findDemoRunnerProject() const noexcept;
|
||||
File findDemoRunnerExecutable() noexcept;
|
||||
File findDemoRunnerProject() noexcept;
|
||||
void launchDemoRunner();
|
||||
|
||||
int numExamples = 0;
|
||||
|
|
|
|||
|
|
@ -403,16 +403,6 @@ bool isPIPFile (const File& file) noexcept
|
|||
return false;
|
||||
}
|
||||
|
||||
File getJUCEExamplesDirectoryPathFromGlobal() noexcept
|
||||
{
|
||||
auto globalPath = getAppSettings().getStoredPath (Ids::jucePath).toString();
|
||||
|
||||
if (globalPath.isNotEmpty())
|
||||
return File (getAppSettings().getStoredPath (Ids::jucePath).toString()).getChildFile ("examples");
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
bool isValidJUCEExamplesDirectory (const File& directory) noexcept
|
||||
{
|
||||
if (! directory.exists() || ! directory.isDirectory() || ! directory.containsSubDirectories())
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ StringArray getModulesRequiredForAudioProcessor() noexcept;
|
|||
|
||||
bool isPIPFile (const File&) noexcept;
|
||||
|
||||
File getJUCEExamplesDirectoryPathFromGlobal() noexcept;
|
||||
bool isValidJUCEExamplesDirectory (const File&) noexcept;
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -395,12 +395,12 @@ Result PIPGenerator::setProjectSettings (ValueTree& jucerTree)
|
|||
|
||||
if (useLocalCopy && isJUCEExample (pipFile))
|
||||
{
|
||||
auto examplesDirectory = getJUCEExamplesDirectoryPathFromGlobal();
|
||||
auto juceDir = getAppSettings().getStoredPath (Ids::jucePath).toString();
|
||||
|
||||
if (isValidJUCEExamplesDirectory (examplesDirectory))
|
||||
if (juceDir.isNotEmpty() && isValidJUCEExamplesDirectory (File (juceDir).getChildFile ("examples")))
|
||||
{
|
||||
defines += ((defines.isEmpty() ? "" : " ") + String ("PIP_JUCE_EXAMPLES_DIRECTORY=")
|
||||
+ Base64::toBase64 (examplesDirectory.getFullPathName()));
|
||||
+ Base64::toBase64 (File (juceDir).getChildFile ("examples").getFullPathName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue