aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod
AgeCommit message (Collapse)Author
2022-08-20refactor: simplify Mod structureflow
No need to keep track of pointers left and right. A single one already gives enough headaches! Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20fix(tests): add timeout on ModFolderModel's testsflow
If the update never ends, the signal is not emitted and we become stuck in the event loop forever. So a very lenient timer is added to prevent that. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20fix: don't give shared pointer to obj. external to the modelflow
It causes some weird problems and adds refcounting overhead. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: adapt rest of the codebase to the new resource modelflow
In order to access the ModFolderModel from the ModFolderPage, i created a new m_model for the correct type, shadowing the m_model of type ResourceFolderModel. This creates two shared_ptr references to the same object, but since they will have the same lifetime, it doesn't generate a memory leak. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: make Resource Pack model inherit from ResourceFolderModelflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: move more tied logic to model and move logic to the resourcesflow
This moves the QSortFilterProxyModel to the resource model files, acessible via a factory method, and moves the sorting and filtering to the objects themselves, decoupling the code a bit. This also adds a basic implementation of methods in the ResourceFolderModel, simplifying the process of constructing a new model from it. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: move things around in the mod modelflow
Makes the method order in the cpp file the same as in the header file. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: move general code from mod model to its own modelflow
This aims to continue decoupling other types of resources (e.g. resource packs, shader packs, etc) from mods, so that we don't have to continuously watch our backs for changes to one of them affecting the others. To do so, this creates a more general list model for resources, based on the mods one, that allows you to extend it with functionality for other resources. I had to do some template and preprocessor stuff to get around the QObject limitation of not allowing templated classes, so that's sadge :c On the other hand, I tried cleaning up most general-purpose code in the mod model, and added some documentation, because it looks nice :D Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-20refactor: move general info from Mod to Resourceflow
This allows us to create other resources that are not Mods, but can still share a significant portion of code. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-11fix: only remove orphaned metadata on first openingflow
This avoids deleting the metadata while one is updating their mods. Signed-off-by: flow <flowlnlnln@gmail.com>
2022-08-02fix: remove orphaned metadata to avoid problems with auto-updating instsflow
Just as my master has taught me. :gun: Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17fix: raw-pointers and leaks in ModFolderLoadTaskflow
Co-authored-by: timoreo <contact@timoreo.fr> Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17fix: std::list -> QListflow
Qt6 removed Qlist::toStdList() :sob: Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17change: use ModStatus as a simple member instead of a pointerflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17change: make Mod a QObject used as a pointerflow
Prevents problems when copying it around! Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17change: mod metadata improvementsflow
- Use slug instead of name - Keep temporary status before having local details Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17fix: mod parsing of 'String-fied' version (i.e. OpenBlocks)flow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17feat: add metadata get/delete via mod idflow
This is, in many cases, more reliable than name comparisons, so it's useful specially in cases where a mod changes name between versions Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17feat: remove existing mod when updating/redownloading itflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17feat: add update mods to the ui / mod modelflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-17change: allow deleting mods while preserving their metadataflow
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-10refactor: fix deprecation up to Qt 6Sefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-10refactor: fix deprecation up to Qt 5.15Sefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-07-03fix: aborts when using a Qt build with assertions enabledflow
Preventing undefined behaviour hooray! :D Signed-off-by: flow <flowlnlnln@gmail.com>
2022-07-02Merge pull request #784 from Scrumplex/refactor-cmakeflow
Refactor tests
2022-06-14Merge pull request #716 from flowln/mod_perma_2Ezekiel Smith
Hide index folder on Windows
2022-06-14refactor: move away from UnitTest.cmakeSefa Eyeoglu
2022-06-13Merge pull request #714 from Scrumplex/fix-testsSefa Eyeoglu
Fix mod metadata tests
2022-06-13refactor: make is_indexed false by defaultSefa Eyeoglu
Co-authored-by: flow <flowlnlnln@gmail.com>
2022-06-12fix: segfault when the same mod is present enabled and disabled at onceflow
This maintains the previous behaviour
2022-06-12fix: correctly handle disabled mods with metadataflow
im stupid
2022-06-12fix: handling of incomplete modsflow
(i.e. mods without ModDetails that may have metadata)
2022-06-12chore: add license headersSefa Eyeoglu
2022-06-12fix(tests): wait until ModFolderModel has updatedSefa Eyeoglu
2022-06-12refactor(test): fix loading mod metadata settingSefa Eyeoglu
2022-06-04fix: hide .index folder on Windowsflow
2022-05-23chore: add license headersflow
Prevents a massive inload of Scrumplex ditto's :) I didn't add it to every file modified in this PR because the other changes are pretty minor, and would explode the diff of the PR. I hope that's not a problem O_O
2022-05-23fix: use correct hash_type when creating metadataflow
also fix: wrong parameter name in LocalModUpdateTask's constructor also fix: correct hash_format in CF
2022-05-23fix: don't try to delete mods multiple timesflow
Shows a more helpful message if there's a parsing error when reading the index file. Also fixes a clazy warning with using the `.data()` method in a temporary QByteArray object.
2022-05-23fix: implement PR suggestionsflow
Some stylistic changes, and get hashes from the mod providers when building the metadata.
2022-05-23refactor: make mod metadata presence (or lack of) easier to find outflow
2022-05-23tidy: apply clang-tidy to some filesflow
Mostly the ones created in this PR + Mod.h / Mod.cpp / ModDetails.h
2022-05-23test+fix: add basic tests and fix issues with itflow
2022-05-23feat: allow disabling mod metadata usageflow
2022-05-23feat: cache metadata in ModDetailsflow
Allows for more easy access to the metadata by outside entities
2022-05-23refactor: abstract metadata handling and clarify namesflow
2022-05-23refactor: remove unused mod info and organize some stuffflow
2022-05-23refactor: move mod tasks to their own subfolderflow
Makes the launcher/minecraft/mod/ folder a little more organized.
2022-05-23feat: use mod metadata for getting mod informationflow
For now this doesn't mean much, but it will help when we need data exclusive from the metadata, such as addon id and mod provider. Also removes the metadata when the mod is deleted, and make the Mod.h file a little more pleasing to look at :)
2022-05-23feat: add method to delete mod metadataflow
Also moves indexDir setting from LocalModUpdateTask -> ModFolderModel