mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +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
|
|
@ -408,7 +408,7 @@ private:
|
|||
for (auto missingModule : missingDependencies)
|
||||
{
|
||||
if (auto* info = list.getModuleWithID (missingModule))
|
||||
modules.addModule (info->moduleFolder, copyLocally, useGlobalPath);
|
||||
modules.addModule (info->moduleFolder, copyLocally, useGlobalPath, false);
|
||||
else
|
||||
missing.add (missingModule);
|
||||
}
|
||||
|
|
@ -543,7 +543,8 @@ public:
|
|||
for (int i = 0; i < modules.size(); ++i)
|
||||
project.getModules().addModule (modules.getReference(i).moduleFolder,
|
||||
project.getModules().areMostModulesCopiedLocally(),
|
||||
project.getModules().areMostModulesUsingGlobalPath());
|
||||
project.getModules().areMostModulesUsingGlobalPath(),
|
||||
true);
|
||||
}
|
||||
|
||||
void addSubItems() override
|
||||
|
|
@ -586,7 +587,6 @@ public:
|
|||
void handlePopupMenuResult (int resultCode) override
|
||||
{
|
||||
auto& modules = project.getModules();
|
||||
auto numModulesBefore = modules.getNumModules();
|
||||
|
||||
if (resultCode == 1001)
|
||||
{
|
||||
|
|
@ -601,14 +601,6 @@ public:
|
|||
else if (resultCode < 400)
|
||||
modules.addModuleInteractive (getAvailableModulesInExporterPaths() [resultCode - 300]);
|
||||
}
|
||||
|
||||
if (modules.getNumModules() == numModulesBefore + 1)
|
||||
{
|
||||
StringPairArray data;
|
||||
data.set ("label", modules.getModuleID (modules.getNumModules() - 1));
|
||||
|
||||
Analytics::getInstance()->logEvent ("Module Added", data, ProjucerAnalyticsEvent::projectEvent);
|
||||
}
|
||||
}
|
||||
|
||||
StringArray getAvailableModulesInGlobalJucePath()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ public:
|
|||
ModuleDescription getModuleInfo (const String& moduleID);
|
||||
File getModuleFolder (const String& moduleID);
|
||||
|
||||
void addModule (const File& moduleManifestFile, bool copyLocally, bool useGlobalPath);
|
||||
void addModule (const File& moduleManifestFile, bool copyLocally, bool useGlobalPath, bool sendAnalyticsEvent);
|
||||
void addModuleInteractive (const String& moduleID);
|
||||
void addModuleFromUserSelectedFile();
|
||||
void addModuleOfferingToCopy (const File&, bool isFromUserSpecifiedFolder);
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ struct NewProjectWizard
|
|||
|
||||
for (int i = 0; i < mods.size(); ++i)
|
||||
if (const ModuleDescription* info = list.getModuleWithID (mods[i]))
|
||||
project.getModules().addModule (info->moduleFolder, false, useGlobalPath);
|
||||
project.getModules().addModule (info->moduleFolder, false, useGlobalPath, false);
|
||||
}
|
||||
|
||||
void addExporters (Project& project, WizardComp& wizardComp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue