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:
flow
2023-01-24 16:52:09 -03:00
parent 5186ad95d3
commit 29f7ea752f
63 changed files with 301 additions and 287 deletions

View File

@ -670,7 +670,7 @@ void TranslationsModel::downloadIndex()
return;
}
qDebug() << "Downloading Translations Index...";
d->m_index_job = new NetJob("Translations Index", APPLICATION->network());
d->m_index_job.reset(new NetJob("Translations Index", APPLICATION->network()));
MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("translations", "index_v2.json");
entry->setStale(true);
d->m_index_task = Net::Download::makeCached(QUrl(BuildConfig.TRANSLATIONS_BASE_URL + "index_v2.json"), entry);
@ -722,7 +722,7 @@ void TranslationsModel::downloadTranslation(QString key)
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawHash));
dl->setProgress(dl->getProgress(), lang->file_size);
d->m_dl_job = new NetJob("Translation for " + key, APPLICATION->network());
d->m_dl_job.reset(new NetJob("Translation for " + key, APPLICATION->network()));
d->m_dl_job->addNetAction(dl);
connect(d->m_dl_job.get(), &NetJob::succeeded, this, &TranslationsModel::dlGood);