Browse Source

Introjucer: a few minor optimisations.

tags/2021-05-28
jules 13 years ago
parent
commit
105929d39f
5 changed files with 12 additions and 7 deletions
  1. +1
    -1
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h
  2. +1
    -3
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp
  3. +4
    -2
      extras/Introjucer/Source/Project/jucer_Module.cpp
  4. +3
    -1
      extras/Introjucer/Source/Utility/jucer_RelativePath.h
  5. +3
    -0
      modules/juce_core/text/juce_Identifier.h

+ 1
- 1
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h View File

@@ -865,7 +865,7 @@ private:
public:
static int compareElements (const ValueTree* first, const ValueTree* second)
{
return first->getType().toString().compare (second->getType().toString());
return first->getType().getCharPointer().compare (second->getType().getCharPointer());
}
private:


+ 1
- 3
extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.cpp View File

@@ -95,9 +95,7 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const Str
ProjectExporter* ProjectExporter::createExporter (Project& project, const ValueTree& settings)
{
ProjectExporter* exp = nullptr;
if (exp == nullptr) exp = MSVCProjectExporterVC2005::createForSettings (project, settings);
ProjectExporter* exp = MSVCProjectExporterVC2005::createForSettings (project, settings);
if (exp == nullptr) exp = MSVCProjectExporterVC2008::createForSettings (project, settings);
if (exp == nullptr) exp = MSVCProjectExporterVC2010::createForSettings (project, settings);
if (exp == nullptr) exp = XCodeProjectExporter ::createForSettings (project, settings);


+ 4
- 2
extras/Introjucer/Source/Project/jucer_Module.cpp View File

@@ -584,8 +584,10 @@ void LibraryModule::findWildcardMatches (const File& localModuleFolder, const St
FileSorter sorter;
DirectoryIterator iter (localModuleFolder.getChildFile (path), false, wildCard);
while (iter.next())
if (! iter.getFile().isHidden())
bool isHiddenFile;
while (iter.next (nullptr, &isHiddenFile, nullptr, nullptr, nullptr, nullptr))
if (! isHiddenFile)
tempList.addSorted (sorter, iter.getFile());
result.addArray (tempList);


+ 3
- 1
extras/Introjucer/Source/Utility/jucer_RelativePath.h View File

@@ -110,7 +110,9 @@ private:
File getFakeFile() const
{
return File::getCurrentWorkingDirectory().getChildFile (path);
// This method gets called very often, so we'll cache this directory.
static const File currentWorkingDirectory (File::getCurrentWorkingDirectory());
return currentWorkingDirectory.getChildFile (path);
}
static bool isAbsolute (const String& path)


+ 3
- 0
modules/juce_core/text/juce_Identifier.h View File

@@ -78,6 +78,9 @@ public:
/** Returns this identifier's raw string pointer. */
operator const String::CharPointerType() const noexcept { return name; }
/** Returns this identifier's raw string pointer. */
const String::CharPointerType getCharPointer() const noexcept { return name; }
/** Checks a given string for characters that might not be valid in an Identifier.
Since Identifiers are used as a script variables and XML attributes, they should only contain
alphanumeric characters, underscores, or the '-' and ':' characters.


Loading…
Cancel
Save