| @@ -98,7 +98,11 @@ void DocumentEditorComponent::getCommandInfo (const CommandID commandID, Applica | |||||
| result.setInfo ("Close" + name, | result.setInfo ("Close" + name, | ||||
| "Closes the current document", | "Closes the current document", | ||||
| CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
| #if JUCE_MAC | |||||
| result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::ctrlModifier, 0)); | |||||
| #else | |||||
| result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | ||||
| #endif | |||||
| break; | break; | ||||
| default: | default: | ||||
| @@ -864,7 +864,6 @@ void Project::removeModule (const String& moduleID) | |||||
| modules.removeChild (i, getUndoManagerFor (modules)); | modules.removeChild (i, getUndoManagerFor (modules)); | ||||
| } | } | ||||
| void Project::createRequiredModules (const ModuleList& availableModules, OwnedArray<LibraryModule>& modules) const | void Project::createRequiredModules (const ModuleList& availableModules, OwnedArray<LibraryModule>& modules) const | ||||
| { | { | ||||
| for (int i = 0; i < availableModules.modules.size(); ++i) | for (int i = 0; i < availableModules.modules.size(); ++i) | ||||
| @@ -223,7 +223,6 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
| "Closes the current project", | "Closes the current project", | ||||
| CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
| result.setActive (project != nullptr); | result.setActive (project != nullptr); | ||||
| result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | |||||
| break; | break; | ||||
| case CommandIDs::openInIDE: | case CommandIDs::openInIDE: | ||||
| @@ -271,6 +271,7 @@ void XmlDocument::skipNextWhiteSpace() | |||||
| && input[2] == '-' | && input[2] == '-' | ||||
| && input[3] == '-') | && input[3] == '-') | ||||
| { | { | ||||
| input += 4; | |||||
| const int closeComment = input.indexOf (CharPointer_UTF8 ("-->")); | const int closeComment = input.indexOf (CharPointer_UTF8 ("-->")); | ||||
| if (closeComment < 0) | if (closeComment < 0) | ||||
| @@ -284,6 +285,7 @@ void XmlDocument::skipNextWhiteSpace() | |||||
| } | } | ||||
| else if (input[1] == '?') | else if (input[1] == '?') | ||||
| { | { | ||||
| input += 2; | |||||
| const int closeBracket = input.indexOf (CharPointer_UTF8 ("?>")); | const int closeBracket = input.indexOf (CharPointer_UTF8 ("?>")); | ||||
| if (closeBracket < 0) | if (closeBracket < 0) | ||||
| @@ -176,16 +176,12 @@ SHA256& SHA256::operator= (const SHA256& other) noexcept | |||||
| SHA256::SHA256 (const MemoryBlock& data) | SHA256::SHA256 (const MemoryBlock& data) | ||||
| { | { | ||||
| MemoryInputStream m (data, false); | |||||
| SHA256Processor processor; | |||||
| processor.processStream (m, -1, result); | |||||
| process (data.getData(), data.getSize()); | |||||
| } | } | ||||
| SHA256::SHA256 (const void* const data, const size_t numBytes) | SHA256::SHA256 (const void* const data, const size_t numBytes) | ||||
| { | { | ||||
| MemoryInputStream m (data, numBytes, false); | |||||
| SHA256Processor processor; | |||||
| processor.processStream (m, -1, result); | |||||
| process (data, numBytes); | |||||
| } | } | ||||
| SHA256::SHA256 (InputStream& input, const int64 numBytesToRead) | SHA256::SHA256 (InputStream& input, const int64 numBytesToRead) | ||||
| @@ -209,6 +205,19 @@ SHA256::SHA256 (const File& file) | |||||
| } | } | ||||
| } | } | ||||
| SHA256::SHA256 (const CharPointer_UTF8& utf8) noexcept | |||||
| { | |||||
| jassert (utf8.getAddress() != nullptr); | |||||
| process (utf8.getAddress(), utf8.sizeInBytes() - 1); | |||||
| } | |||||
| void SHA256::process (const void* const data, size_t numBytes) | |||||
| { | |||||
| MemoryInputStream m (data, numBytes, false); | |||||
| SHA256Processor processor; | |||||
| processor.processStream (m, -1, result); | |||||
| } | |||||
| MemoryBlock SHA256::getRawData() const | MemoryBlock SHA256::getRawData() const | ||||
| { | { | ||||
| return MemoryBlock (result, sizeof (result)); | return MemoryBlock (result, sizeof (result)); | ||||
| @@ -77,6 +77,13 @@ public: | |||||
| */ | */ | ||||
| explicit SHA256 (const File& file); | explicit SHA256 (const File& file); | ||||
| /** Creates a checksum from a UTF-8 buffer. | |||||
| E.g. | |||||
| @code SHA256 checksum (myString.toUTF8()); | |||||
| @endcode | |||||
| */ | |||||
| explicit SHA256 (const CharPointer_UTF8& utf8Text) noexcept; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Returns the hash as a 32-byte block of data. */ | /** Returns the hash as a 32-byte block of data. */ | ||||
| MemoryBlock getRawData() const; | MemoryBlock getRawData() const; | ||||
| @@ -92,6 +99,7 @@ public: | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| uint8 result [32]; | uint8 result [32]; | ||||
| void process (const void*, size_t); | |||||
| JUCE_LEAK_DETECTOR (SHA256); | JUCE_LEAK_DETECTOR (SHA256); | ||||
| }; | }; | ||||
| @@ -193,7 +193,7 @@ void FileChooser::showPlatformDialog (Array<File>& results, | |||||
| filename = currentFileOrDirectory.getFileName(); | filename = currentFileOrDirectory.getFileName(); | ||||
| } | } | ||||
| #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 | |||||
| #if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) | |||||
| [panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]]; | [panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]]; | ||||
| [panel setNameFieldStringValue: juceStringToNS (filename)]; | [panel setNameFieldStringValue: juceStringToNS (filename)]; | ||||