mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
refactor: make shared_qobject_ptr ctor explicit
This turns issues like creating two shared ptrs from a single raw ptr from popping up at runtime, instead making them a compile error. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -36,12 +36,11 @@ class DummyResourceAPI : public ResourceAPI {
|
||||
|
||||
[[nodiscard]] Task::Ptr searchProjects(SearchArgs&&, SearchCallbacks&& callbacks) const override
|
||||
{
|
||||
auto task = new SearchTask;
|
||||
QObject::connect(task, &Task::succeeded, [=] {
|
||||
auto task = makeShared<SearchTask>();
|
||||
QObject::connect(task.get(), &Task::succeeded, [=] {
|
||||
auto json = searchRequestResult();
|
||||
callbacks.on_succeed(json);
|
||||
});
|
||||
QObject::connect(task, &Task::finished, task, &Task::deleteLater);
|
||||
return task;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user