From 5ffd878ebc61ede9c6a79de62c2ac12cbf4c4722 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 12 Nov 2013 10:29:04 +0000 Subject: [PATCH] Introjucer: made modules work better when the project doesn't contain any targets that will build on the current OS. --- .../Source/Project/jucer_Module.cpp | 33 +++++++++++-------- .../Introjucer/Source/Project/jucer_Module.h | 2 ++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/extras/Introjucer/Source/Project/jucer_Module.cpp b/extras/Introjucer/Source/Project/jucer_Module.cpp index 139d9c2c58..00e31e494f 100644 --- a/extras/Introjucer/Source/Project/jucer_Module.cpp +++ b/extras/Introjucer/Source/Project/jucer_Module.cpp @@ -131,21 +131,18 @@ static Array getAllPossibleModulePaths (Project& project) for (Project::ExporterIterator exporter (project); exporter.next();) { - if (exporter->mayCompileOnCurrentOS()) + for (int i = 0; i < project.getModules().getNumModules(); ++i) { - for (int i = 0; i < project.getModules().getNumModules(); ++i) - { - const String path (exporter->getPathForModuleString (project.getModules().getModuleID (i))); + const String path (exporter->getPathForModuleString (project.getModules().getModuleID (i))); - if (path.isNotEmpty()) - paths.addIfNotAlreadyThere (path); - } + if (path.isNotEmpty()) + paths.addIfNotAlreadyThere (path); + } - String oldPath (exporter->getLegacyModulePath()); + String oldPath (exporter->getLegacyModulePath()); - if (oldPath.isNotEmpty()) - paths.addIfNotAlreadyThere (oldPath); - } + if (oldPath.isNotEmpty()) + paths.addIfNotAlreadyThere (oldPath); } Array files; @@ -619,11 +616,11 @@ Value EnabledModuleList::shouldShowAllModuleFilesInProject (const String& module .getPropertyAsValue (Ids::showAllCode, getUndoManager()); } -File EnabledModuleList::getModuleInfoFile (const String& moduleID) +File EnabledModuleList::findLocalModuleInfoFile (const String& moduleID, bool useExportersForOtherOSes) { for (Project::ExporterIterator exporter (project); exporter.next();) { - if (exporter->mayCompileOnCurrentOS()) + if (useExportersForOtherOSes || exporter->mayCompileOnCurrentOS()) { const String path (exporter->getPathForModuleString (moduleID)); @@ -658,6 +655,16 @@ File EnabledModuleList::getModuleInfoFile (const String& moduleID) return File::nonexistent; } +File EnabledModuleList::getModuleInfoFile (const String& moduleID) +{ + const File f (findLocalModuleInfoFile (moduleID, false)); + + if (f != File::nonexistent) + return f; + + return findLocalModuleInfoFile (moduleID, true); +} + File EnabledModuleList::getModuleFolder (const String& moduleID) { const File infoFile (getModuleInfoFile (moduleID)); diff --git a/extras/Introjucer/Source/Project/jucer_Module.h b/extras/Introjucer/Source/Project/jucer_Module.h index be767b7823..175585b53c 100644 --- a/extras/Introjucer/Source/Project/jucer_Module.h +++ b/extras/Introjucer/Source/Project/jucer_Module.h @@ -155,6 +155,8 @@ public: private: UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); } + File findLocalModuleInfoFile (const String& moduleID, bool useExportersForOtherOSes); + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EnabledModuleList) };