1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

PluginListComponent: Use lambda form of ModalCallbackFunction

This commit is contained in:
reuk 2025-06-03 17:40:12 +01:00
parent 5d50d6bcdc
commit dc890c69c2
No known key found for this signature in database

View file

@ -194,9 +194,13 @@ public:
pathChooserWindow.addButton (TRANS ("Cancel"), 0, KeyPress (KeyPress::escapeKey));
pathChooserWindow.enterModalState (true,
ModalCallbackFunction::forComponent (startScanCallback,
&pathChooserWindow, this),
false);
ModalCallbackFunction::create ([this] (auto result)
{
if (result != 0)
warnUserAboutStupidPaths();
else
finishedScan();
}));
}
else
{
@ -230,17 +234,6 @@ private:
std::set<String> initiallyBlacklistedFiles;
ScopedMessageBox messageBox;
static void startScanCallback (int result, AlertWindow* alert, Scanner* scanner)
{
if (alert != nullptr && scanner != nullptr)
{
if (result != 0)
scanner->warnUserAboutStupidPaths();
else
scanner->finishedScan();
}
}
// Try to dissuade people from to scanning their entire C: drive, or other system folders.
void warnUserAboutStupidPaths()
{