mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Projucer: Ensure that "Module Added" analytics events are only sent once and not sent when creating a new project
This commit is contained in:
parent
5385102d45
commit
b999047748
4 changed files with 18 additions and 22 deletions
|
|
@ -775,7 +775,7 @@ Value EnabledModuleList::shouldCopyModuleFilesLocally (const String& moduleID) c
|
|||
.getPropertyAsValue (Ids::useLocalCopy, getUndoManager());
|
||||
}
|
||||
|
||||
void EnabledModuleList::addModule (const File& moduleFolder, bool copyLocally, bool useGlobalPath)
|
||||
void EnabledModuleList::addModule (const File& moduleFolder, bool copyLocally, bool useGlobalPath, bool sendAnalyticsEvent)
|
||||
{
|
||||
ModuleDescription info (moduleFolder);
|
||||
|
||||
|
|
@ -801,10 +801,13 @@ void EnabledModuleList::addModule (const File& moduleFolder, bool copyLocally, b
|
|||
for (Project::ExporterIterator exporter (project); exporter.next();)
|
||||
exporter->getPathForModuleValue (moduleID) = path.toUnixStyle();
|
||||
|
||||
StringPairArray data;
|
||||
data.set ("label", moduleID);
|
||||
if (sendAnalyticsEvent)
|
||||
{
|
||||
StringPairArray data;
|
||||
data.set ("label", moduleID);
|
||||
|
||||
Analytics::getInstance()->logEvent ("Module Added", data, ProjucerAnalyticsEvent::projectEvent);
|
||||
Analytics::getInstance()->logEvent ("Module Added", data, ProjucerAnalyticsEvent::projectEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -961,20 +964,20 @@ void EnabledModuleList::addModuleInteractive (const String& moduleID)
|
|||
list.scanGlobalJuceModulePath();
|
||||
if (auto* info = list.getModuleWithID (moduleID))
|
||||
{
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), areMostModulesUsingGlobalPath());
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), areMostModulesUsingGlobalPath(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
list.scanGlobalUserModulePath();
|
||||
if (auto* info = list.getModuleWithID (moduleID))
|
||||
{
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), areMostModulesUsingGlobalPath());
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), areMostModulesUsingGlobalPath(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
list.scanProjectExporterModulePaths (project);
|
||||
if (auto* info = list.getModuleWithID (moduleID))
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), false);
|
||||
addModule (info->moduleFolder, areMostModulesCopiedLocally(), false, true);
|
||||
else
|
||||
addModuleFromUserSelectedFile();
|
||||
}
|
||||
|
|
@ -997,8 +1000,9 @@ void EnabledModuleList::addModuleOfferingToCopy (const File& f, bool isFromUserS
|
|||
return;
|
||||
}
|
||||
|
||||
addModule (m.moduleFolder, areMostModulesCopiedLocally(), isFromUserSpecifiedFolder ? false
|
||||
: areMostModulesUsingGlobalPath());
|
||||
addModule (m.moduleFolder, areMostModulesCopiedLocally(),
|
||||
isFromUserSpecifiedFolder ? false : areMostModulesUsingGlobalPath(),
|
||||
true);
|
||||
}
|
||||
|
||||
bool isJUCEFolder (const File& f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue