mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
Improved CoreGraphics clipping. Added a method File::revealToUser(). Added obj-c keywords to the c++ tokeniser. Added a new mode to the file chooser (only implemented on mac so far)
This commit is contained in:
parent
9a39433405
commit
71a12a140e
15 changed files with 115 additions and 29 deletions
|
|
@ -417,10 +417,11 @@ bool juce_launchFile (const String& fileName,
|
|||
cmdString << " " << parameters;
|
||||
|
||||
if (URL::isProbablyAWebsiteURL (fileName)
|
||||
|| cmdString.startsWithIgnoreCase (T("file:"))
|
||||
|| URL::isProbablyAnEmailAddress (fileName))
|
||||
{
|
||||
// create a command that tries to launch a bunch of likely browsers
|
||||
const char* const browserNames[] = { "/etc/alternatives/x-www-browser", "firefox", "mozilla", "konqueror", "opera" };
|
||||
const char* const browserNames[] = { "xdg-open", "/etc/alternatives/x-www-browser", "firefox", "mozilla", "konqueror", "opera" };
|
||||
|
||||
StringArray cmdLines;
|
||||
|
||||
|
|
@ -430,9 +431,6 @@ bool juce_launchFile (const String& fileName,
|
|||
cmdString = cmdLines.joinIntoString (T(" || "));
|
||||
}
|
||||
|
||||
if (cmdString.startsWithIgnoreCase (T("file:")))
|
||||
cmdString = cmdString.substring (5);
|
||||
|
||||
const char* const argv[4] = { "/bin/sh", "-c", (const char*) cmdString.toUTF8(), 0 };
|
||||
|
||||
const int cpid = fork();
|
||||
|
|
@ -449,4 +447,13 @@ bool juce_launchFile (const String& fileName,
|
|||
return cpid >= 0;
|
||||
}
|
||||
|
||||
void File::revealToUser() const throw()
|
||||
{
|
||||
if (isDirectory())
|
||||
startAsProcess();
|
||||
else if (getParentDirectory().exists())
|
||||
getParentDirectory().startAsProcess();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue