1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-09 04:30:09 +00:00

Linux: Fixed a bug in detecting which native file browser to use on Manjaro where which returns a non-empty string on failure and fixed a bug in zenity wildcard args

This commit is contained in:
ed 2020-07-15 17:09:01 +01:00
parent 9db01c4362
commit e92749e7ca

View file

@ -26,14 +26,19 @@
namespace juce
{
static bool exeIsAvailable (const char* const executable)
static bool exeIsAvailable (String executable)
{
ChildProcess child;
const bool ok = child.start ("which " + String (executable))
&& child.readAllProcessOutput().trim().isNotEmpty();
child.waitForProcessToFinish (60 * 1000);
return ok;
if (child.start ("which " + executable))
{
auto output = child.readAllProcessOutput().trim();
child.waitForProcessToFinish (60 * 1000);
return output.isNotEmpty() && ! output.contains ("no " + executable);
}
return false;
}
@ -67,7 +72,7 @@ public:
child.start (args, ChildProcess::wantStdOut);
while (child.isRunning())
if (! MessageManager::getInstance()->runDispatchLoopUntil(20))
if (! MessageManager::getInstance()->runDispatchLoopUntil (20))
break;
finish (false);
@ -217,8 +222,7 @@ private:
StringArray tokens;
tokens.addTokens (owner.filters, ";,|", "\"");
for (int i = 0; i < tokens.size(); ++i)
args.add ("--file-filter=" + tokens[i]);
args.add ("--file-filter=" + tokens.joinIntoString (" "));
}
if (owner.startingFile.isDirectory())