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