Browse Source

Projucer: Remove getJUCEExamplesDirectoryPathFromGlobal() from jucer_MiscUtilities.h

tags/2021-05-28
ed 7 years ago
parent
commit
dbaca088b3
5 changed files with 20 additions and 20 deletions
  1. +13
    -3
      extras/Projucer/Source/Application/jucer_Application.cpp
  2. +4
    -3
      extras/Projucer/Source/Application/jucer_Application.h
  3. +0
    -10
      extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.cpp
  4. +0
    -1
      extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h
  5. +3
    -3
      extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp

+ 13
- 3
extras/Projucer/Source/Application/jucer_Application.cpp View File

@@ -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");


+ 4
- 3
extras/Projucer/Source/Application/jucer_Application.h View File

@@ -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;


+ 0
- 10
extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.cpp View File

@@ -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())


+ 0
- 1
extras/Projucer/Source/Utility/Helpers/jucer_MiscUtilities.h View File

@@ -68,7 +68,6 @@ StringArray getModulesRequiredForAudioProcessor() noexcept;
bool isPIPFile (const File&) noexcept;
File getJUCEExamplesDirectoryPathFromGlobal() noexcept;
bool isValidJUCEExamplesDirectory (const File&) noexcept;
//==============================================================================


+ 3
- 3
extras/Projucer/Source/Utility/PIPs/jucer_PIPGenerator.cpp View File

@@ -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…
Cancel
Save