Commit Graph

8 Commits

Author SHA1 Message Date
flow
ea5020e188
fix(license): add/fix my copyright/license headers
*sobbing in messy legal stuff i know nothing about*

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-23 11:12:43 -03:00
flow
ba677a8cb7
refactor: change some ResourceAPI from NetJob to Task
This makes it easier to create resource apis that aren't network-based.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:09 -03:00
flow
7d128c79a3
fix: CodeQL warnings about the rule of two
shush

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
38e20eb148
fix(RD): pass copy of IndexedPack to callbacks instead of ref.
This prevents a crash in which the pack list gets updated in a search
request meanwhile a versions / extra info request is being processed.
Previously, this situation would cause the reference in the latter
callbacks to be invalidated by an internal relocation of the pack list.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
36571c5e22
refactor(RD): clear up sorting methods
This refactors the sorting methods to join every bit of it into a single
list, easing maintanance. It also removes the weird index contraint on
the list of methods by adding an index field to the DS that holds the
method.

Lastly, it puts the available methods on their respective API, so other
resources on the same API can re-use them later on.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
c8eca4fb85
fix: build with qt5.12 on Linux and pedantic flag
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
45d1319891
refactor(RD): decouple ResourceModels from ResourcePages
This makes it so that we don't need a reference to the parent page in
the model. It will be useful once we change the page from a widget-based
one to a QML page.

It also makes tasks be created in the dialog instead of the page, so
that the dialog can also have the necessary information to mark versions
as selected / deselected easily. It also makes the task pointers into
smart pointers.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
6a18079953
refactor: generalize mod models and APIs to resources
Firstly, this abstract away behavior in the mod download models that can
also be applied to other types of resources into a superclass, allowing
other resource types to be implemented without so much code duplication.

For that, this also generalizes the APIs used (currently, ModrinthAPI
and FlameAPI) to be able to make requests to other types of resources.

It also does a general cleanup of both of those. In particular, this
makes use of std::optional instead of invalid values for errors and,
well, optional values :p

This is a squash of some commits that were becoming too interlaced
together to be cleanly separated.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:00 -03:00