diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-01-27 22:23:07 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-01-27 22:23:07 +0100 |
commit | 986141b5035c99747c7e06cd447b8b4e27eb2b27 (patch) | |
tree | 3de534a0192bb62d4654342bf0d89b7e46d41cae /logic/OneSixVersionBuilder.cpp | |
parent | 176783c8caacafd5d320c2fef7374335ee54796b (diff) | |
download | MultiMC-986141b5035c99747c7e06cd447b8b4e27eb2b27.tar MultiMC-986141b5035c99747c7e06cd447b8b4e27eb2b27.tar.gz MultiMC-986141b5035c99747c7e06cd447b8b4e27eb2b27.tar.lz MultiMC-986141b5035c99747c7e06cd447b8b4e27eb2b27.tar.xz MultiMC-986141b5035c99747c7e06cd447b8b4e27eb2b27.zip |
Fix library ordering
Diffstat (limited to 'logic/OneSixVersionBuilder.cpp')
-rw-r--r-- | logic/OneSixVersionBuilder.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/logic/OneSixVersionBuilder.cpp b/logic/OneSixVersionBuilder.cpp index c031a94a..3b119b45 100644 --- a/logic/OneSixVersionBuilder.cpp +++ b/logic/OneSixVersionBuilder.cpp @@ -70,8 +70,8 @@ struct VersionFile Apply, Append, Prepend, - InsertBefore, - InsertAfter, + AppendIfNotExists, + PrependIfNotExists, Replace }; InsertType insertType; @@ -408,13 +408,13 @@ struct VersionFile { lib.insertType = Library::Prepend; } - else if (insertString == "before") + else if (insertString == "prepend-if-not-exists") { - lib.insertType = Library::InsertBefore; + lib.insertType = Library::PrependIfNotExists; } - else if (insertString == "after") + else if (insertString == "append-if-not-exists") { - lib.insertType = Library::InsertAfter; + lib.insertType = Library::PrependIfNotExists; } else if (insertString == "replace") { @@ -613,31 +613,23 @@ struct VersionFile case Library::Prepend: version->libraries.prepend(createLibrary(lib)); break; - case Library::InsertBefore: + case Library::AppendIfNotExists: { - int index = findLibrary(version->libraries, lib.insertData); - if (index >= 0) - { - version->libraries.insert(index, createLibrary(lib)); - } - else + int index = findLibrary(version->libraries, lib.name); + if (index < 0) { - QLOG_WARN() << "Couldn't find" << lib.insertData << "(skipping)"; + version->libraries.append(createLibrary(lib)); } break; } - case Library::InsertAfter: + case Library::PrependIfNotExists: { - int index = findLibrary(version->libraries, lib.insertData); - if (index >= 0) - { - version->libraries.insert(index + 1, createLibrary(lib)); - } - else + int index = findLibrary(version->libraries, lib.name); + if (index < 0) { - QLOG_WARN() << "Couldn't find" << lib.insertData << "(skipping)"; + version->libraries.prepend(createLibrary(lib)); } break; } |