Skip to content

Commit 591f21b

Browse files
committed
Fixed deprecated method use
1 parent 5248de2 commit 591f21b

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

Source/MainComponent.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,26 +212,19 @@ MainComponent::MainComponent (Validator& v)
212212
testSelectedButton.onClick = [this]
213213
{
214214
auto rows = pluginListComponent.getTableListBox().getSelectedRows();
215-
Array<PluginDescription*> plugins;
215+
Array<PluginDescription> plugins;
216216

217217
for (int i = 0; i < rows.size(); ++i)
218-
if (auto pd = knownPluginList.getType (rows[i]))
219-
plugins.add (pd);
218+
plugins.add (knownPluginList.getTypes()[rows[i]]);
220219

221220
validator.setValidateInProcess (getValidateInProcess());
222221
validator.validate (plugins, getTestOptions());
223222
};
224223

225224
testAllButton.onClick = [this]
226225
{
227-
Array<PluginDescription*> plugins;
228-
229-
for (int i = 0; i < knownPluginList.getNumTypes(); ++i)
230-
if (auto pd = knownPluginList.getType (i))
231-
plugins.add (pd);
232-
233226
validator.setValidateInProcess (getValidateInProcess());
234-
validator.validate (plugins, getTestOptions());
227+
validator.validate (knownPluginList.getTypes(), getTestOptions());
235228
};
236229

237230
testFileButton.onClick = [this]

Source/Validator.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include "CrashHandler.h"
1818
#include <numeric>
1919

20+
#if JUCE_MAC
21+
#include <signal.h>
22+
#endif
23+
2024
// Defined in Main.cpp, used to create the file logger as early as possible
2125
extern void slaveInitialised();
2226

@@ -274,7 +278,7 @@ static MemoryBlock valueTreeToMemoryBlock (const ValueTree& v)
274278
static String toXmlString (const ValueTree& v)
275279
{
276280
if (auto xml = std::unique_ptr<XmlElement> (v.createXml()))
277-
return xml->createDocument ({}, false, false);
281+
return xml->toString (XmlElement::TextFormat().withoutHeader());
278282

279283
return {};
280284
}
@@ -630,13 +634,13 @@ class ValidatorMasterProcess : public ChildProcessMaster
630634
}
631635

632636
/** Triggers validation of a set of PluginDescriptions. */
633-
void validate (const Array<PluginDescription*>& pluginsToValidate, PluginTests::Options options)
637+
void validate (const Array<PluginDescription>& pluginsToValidate, PluginTests::Options options)
634638
{
635639
auto v = createPluginsTree (options);
636640

637641
for (auto pd : pluginsToValidate)
638-
if (auto xml = std::unique_ptr<XmlElement> (pd->createXml()))
639-
v.appendChild ({ IDs::PLUGIN, {{ IDs::pluginDescription, Base64::toBase64 (xml->createDocument ("")) }} }, nullptr);
642+
if (auto xml = std::unique_ptr<XmlElement> (pd.createXml()))
643+
v.appendChild ({ IDs::PLUGIN, {{ IDs::pluginDescription, Base64::toBase64 (xml->toString()) }} }, nullptr);
640644

641645
sendValueTreeToSlave (v);
642646
}
@@ -700,7 +704,7 @@ bool Validator::validate (const StringArray& fileOrIDsToValidate, PluginTests::O
700704
return true;
701705
}
702706

703-
bool Validator::validate (const Array<PluginDescription*>& pluginsToValidate, PluginTests::Options options)
707+
bool Validator::validate (const Array<PluginDescription>& pluginsToValidate, PluginTests::Options options)
704708
{
705709
if (! ensureConnection())
706710
return false;

Source/Validator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Validator : public ChangeBroadcaster,
5050
bool validate (const StringArray& fileOrIDsToValidate, PluginTests::Options);
5151

5252
/** Validates an array of PluginDescriptions. */
53-
bool validate (const Array<PluginDescription*>& pluginsToValidate, PluginTests::Options);
53+
bool validate (const Array<PluginDescription>& pluginsToValidate, PluginTests::Options);
5454

5555
/** Call this to make validation happen in the same process.
5656
This can be useful for debugging but should not generally be used as a crashing

0 commit comments

Comments
 (0)