Commit 967a4b43 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated qVariantFromValue method

parent 08d1f48a
......@@ -73,7 +73,7 @@ void CategoryModel::populateCategories()
QVariantList CategoryModel::rootCategoriesVL() const
{
return kTransform<QVariantList>(m_rootCategories, [](Category* cat) {return qVariantFromValue<QObject*>(cat); });
return kTransform<QVariantList>(m_rootCategories, [](Category* cat) {return QVariant::fromValue<QObject*>(cat); });
}
void CategoryModel::blacklistPlugin(const QString &name)
......
......@@ -109,9 +109,9 @@ QVariant TransactionModel::data(const QModelIndex &index, int role) const
}
break;
case TransactionRole:
return qVariantFromValue<QObject*>(trans);
return QVariant::fromValue<QObject*>(trans);
case ResourceRole:
return qVariantFromValue<QObject*>(trans->resource());
return QVariant::fromValue<QObject*>(trans->resource());
}
return QVariant();
......
......@@ -72,7 +72,7 @@ void KNSReviews::fetchReviews(AbstractResource* app, int page)
emit reviewsReady(app, {}, false);
return;
}
job->setProperty("app", qVariantFromValue<AbstractResource*>(app));
job->setProperty("app", QVariant::fromValue<AbstractResource*>(app));
connect(job, &Attica::BaseJob::finished, this, &KNSReviews::commentsReceived);
job->start();
m_fetching++;
......
......@@ -412,7 +412,7 @@ QVariant ResourcesProxyModel::roleToValue(AbstractResource* resource, int role)
{
switch(role) {
case ApplicationRole:
return qVariantFromValue<QObject*>(resource);
return QVariant::fromValue<QObject*>(resource);
case RatingPointsRole:
case RatingRole:
case RatingCountRole:
......
......@@ -58,7 +58,7 @@ void SourcesModel::addSourcesBackend(AbstractSourcesBackend* sources)
auto m = sources->sources();
m->setProperty(DisplayName, backend->displayName());
m->setProperty(SourcesBackendId, qVariantFromValue<QObject*>(sources));
m->setProperty(SourcesBackendId, QVariant::fromValue<QObject*>(sources));
addSourceModel(m);
if (!m->rowCount())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment