diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-06 23:31:23 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:02 +0200 |
commit | 8e58d61150b0bdbe9eb91065d36342f3004fe97b (patch) | |
tree | c5b0d30d425003c4b88e84a2908e63eb5ed797b9 /api/logic/minecraft/MinecraftProfile.cpp | |
parent | dddc5cedf380d1321b94b0bc7d244d23289e6d3c (diff) | |
download | PrismLauncher-8e58d61150b0bdbe9eb91065d36342f3004fe97b.tar.gz PrismLauncher-8e58d61150b0bdbe9eb91065d36342f3004fe97b.tar.bz2 PrismLauncher-8e58d61150b0bdbe9eb91065d36342f3004fe97b.zip |
NOISSUE fix issue with the narrator feature by splitting java and native libraries
Diffstat (limited to 'api/logic/minecraft/MinecraftProfile.cpp')
-rw-r--r-- | api/logic/minecraft/MinecraftProfile.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/api/logic/minecraft/MinecraftProfile.cpp b/api/logic/minecraft/MinecraftProfile.cpp index 8638f5fa..c04669c1 100644 --- a/api/logic/minecraft/MinecraftProfile.cpp +++ b/api/logic/minecraft/MinecraftProfile.cpp @@ -491,20 +491,29 @@ void MinecraftProfile::applyLibrary(LibraryPtr library) { return; } + + QList<LibraryPtr> * list = &m_libraries; + if(library->isNative()) + { + list = &m_nativeLibraries; + } + + auto libraryCopy = Library::limitedCopy(library); + // find the library by name. - const int index = findLibraryByName(m_libraries, library->rawName()); + const int index = findLibraryByName(*list, library->rawName()); // library not found? just add it. if (index < 0) { - m_libraries.append(Library::limitedCopy(library)); + list->append(libraryCopy); return; } - auto existingLibrary = m_libraries.at(index); + + auto existingLibrary = list->at(index); // if we are higher it means we should update if (Version(library->version()) > Version(existingLibrary->version())) { - auto libraryCopy = Library::limitedCopy(library); - m_libraries.replace(index, libraryCopy); + list->replace(index, libraryCopy); } } @@ -581,6 +590,11 @@ const QList<LibraryPtr> & MinecraftProfile::getLibraries() const return m_libraries; } +const QList<LibraryPtr> & MinecraftProfile::getNativeLibraries() const +{ + return m_nativeLibraries; +} + void MinecraftProfile::getLibraryFiles(const QString& architecture, QStringList& jars, QStringList& nativeJars, const QString& overridePath) const { QStringList native32, native64; @@ -590,6 +604,10 @@ void MinecraftProfile::getLibraryFiles(const QString& architecture, QStringList& { lib->getApplicableFiles(currentSystem, jars, nativeJars, native32, native64, overridePath); } + for (auto lib : getNativeLibraries()) + { + lib->getApplicableFiles(currentSystem, jars, nativeJars, native32, native64, overridePath); + } if(architecture == "32") { nativeJars.append(native32); |