| 172 | } |
| 173 | |
| 174 | void LaunchProfile::applyLibrary(LibraryPtr library, const RuntimeContext& runtimeContext) |
| 175 | { |
| 176 | if (!library->isActive(runtimeContext)) { |
| 177 | return; |
| 178 | } |
| 179 | |
| 180 | QList<LibraryPtr>* list = &m_libraries; |
| 181 | if (library->isNative()) { |
| 182 | list = &m_nativeLibraries; |
| 183 | } |
| 184 | |
| 185 | auto libraryCopy = Library::limitedCopy(library); |
| 186 | |
| 187 | // find the library by name. |
| 188 | const int index = findLibraryByName(list, library->rawName()); |
| 189 | // library not found? just add it. |
| 190 | if (index < 0) { |
| 191 | list->append(libraryCopy); |
| 192 | return; |
| 193 | } |
| 194 | |
| 195 | auto existingLibrary = list->at(index); |
| 196 | // if we are higher it means we should update |
| 197 | if (Version(library->version()) > Version(existingLibrary->version())) { |
| 198 | list->replace(index, libraryCopy); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | void LaunchProfile::applyMavenFile(LibraryPtr mavenFile, const RuntimeContext& runtimeContext) |
| 203 | { |