Commit c72349a8 authored by Marco Martin's avatar Marco Martin

kservices in MenuItem can be not valid

BUG:381701
parent 45130497
......@@ -178,9 +178,17 @@ public:
case Qt::UserRole:
return QVariant::fromValue(mi);
case Qt::DisplayRole:
return mi->service()->name();
if (mi->service() && mi->service()->isValid()) {
return mi->service()->name();
} else {
return QVariant();
}
case Qt::DecorationRole:
return mi->service()->icon();
if (mi->service() && mi->service()->isValid()) {
return mi->service()->icon();
} else {
return QVariant();
}
case ResultModel::ScoreRole:
return QSortFilterProxyModel::data(index, ResultModel::ScoreRole).toInt();
default:
......
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