mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-20 01:14:20 +00:00
ActiveX browser plugin fix. File extension changes in the new jucer.
This commit is contained in:
parent
d033a859ef
commit
a9c2f2c69e
14 changed files with 93 additions and 90 deletions
|
|
@ -106,6 +106,26 @@ bool File::isHidden() const
|
|||
return getFileName().startsWithChar ('.');
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static const File juce_readlink (const char* const utf8, const File& defaultFile)
|
||||
{
|
||||
const int size = 8192;
|
||||
HeapBlock<char> buffer;
|
||||
buffer.malloc (size + 4);
|
||||
|
||||
const size_t numBytes = readlink (utf8, buffer, size);
|
||||
|
||||
if (numBytes > 0 && numBytes <= size)
|
||||
return File (String::fromUTF8 (buffer, (int) numBytes));
|
||||
|
||||
return defaultFile;
|
||||
}
|
||||
|
||||
const File File::getLinkedTarget() const
|
||||
{
|
||||
return juce_readlink (getFullPathName().toUTF8(), *this);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const char* juce_Argv0 = 0; // referenced from juce_Application.cpp
|
||||
|
||||
|
|
@ -167,14 +187,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
|
|||
return juce_getExecutableFile();
|
||||
|
||||
case hostApplicationPath:
|
||||
{
|
||||
unsigned int size = 8192;
|
||||
HeapBlock<char> buffer;
|
||||
buffer.calloc (size + 8);
|
||||
|
||||
readlink ("/proc/self/exe", buffer.getData(), size);
|
||||
return String::fromUTF8 (buffer, size);
|
||||
}
|
||||
return juce_readlink ("/proc/self/exe", juce_getExecutableFile());
|
||||
|
||||
default:
|
||||
jassertfalse; // unknown type?
|
||||
|
|
@ -190,19 +203,6 @@ const String File::getVersion() const
|
|||
return String::empty; // xxx not yet implemented
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
const File File::getLinkedTarget() const
|
||||
{
|
||||
char buffer [4096];
|
||||
size_t numChars = readlink (getFullPathName().toUTF8(),
|
||||
buffer, sizeof (buffer));
|
||||
|
||||
if (numChars > 0 && numChars <= sizeof (buffer))
|
||||
return File (String::fromUTF8 (buffer, (int) numChars));
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
bool File::moveToTrash() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue