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() ...@@ -73,7 +73,7 @@ void CategoryModel::populateCategories()
QVariantList CategoryModel::rootCategoriesVL() const 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) void CategoryModel::blacklistPlugin(const QString &name)
......
...@@ -109,9 +109,9 @@ QVariant TransactionModel::data(const QModelIndex &index, int role) const ...@@ -109,9 +109,9 @@ QVariant TransactionModel::data(const QModelIndex &index, int role) const
} }
break; break;
case TransactionRole: case TransactionRole:
return qVariantFromValue<QObject*>(trans); return QVariant::fromValue<QObject*>(trans);
case ResourceRole: case ResourceRole:
return qVariantFromValue<QObject*>(trans->resource()); return QVariant::fromValue<QObject*>(trans->resource());
} }
return QVariant(); return QVariant();
......
...@@ -72,7 +72,7 @@ void KNSReviews::fetchReviews(AbstractResource* app, int page) ...@@ -72,7 +72,7 @@ void KNSReviews::fetchReviews(AbstractResource* app, int page)
emit reviewsReady(app, {}, false); emit reviewsReady(app, {}, false);
return; return;
} }
job->setProperty("app", qVariantFromValue<AbstractResource*>(app)); job->setProperty("app", QVariant::fromValue<AbstractResource*>(app));
connect(job, &Attica::BaseJob::finished, this, &KNSReviews::commentsReceived); connect(job, &Attica::BaseJob::finished, this, &KNSReviews::commentsReceived);
job->start(); job->start();
m_fetching++; m_fetching++;
......
...@@ -412,7 +412,7 @@ QVariant ResourcesProxyModel::roleToValue(AbstractResource* resource, int role) ...@@ -412,7 +412,7 @@ QVariant ResourcesProxyModel::roleToValue(AbstractResource* resource, int role)
{ {
switch(role) { switch(role) {
case ApplicationRole: case ApplicationRole:
return qVariantFromValue<QObject*>(resource); return QVariant::fromValue<QObject*>(resource);
case RatingPointsRole: case RatingPointsRole:
case RatingRole: case RatingRole:
case RatingCountRole: case RatingCountRole:
......
...@@ -58,7 +58,7 @@ void SourcesModel::addSourcesBackend(AbstractSourcesBackend* sources) ...@@ -58,7 +58,7 @@ void SourcesModel::addSourcesBackend(AbstractSourcesBackend* sources)
auto m = sources->sources(); auto m = sources->sources();
m->setProperty(DisplayName, backend->displayName()); m->setProperty(DisplayName, backend->displayName());
m->setProperty(SourcesBackendId, qVariantFromValue<QObject*>(sources)); m->setProperty(SourcesBackendId, QVariant::fromValue<QObject*>(sources));
addSourceModel(m); addSourceModel(m);
if (!m->rowCount()) 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