diff --git a/src/models/appsmodel.cpp b/src/models/appsmodel.cpp index 23ecef10..f2086062 100644 --- a/src/models/appsmodel.cpp +++ b/src/models/appsmodel.cpp @@ -293,7 +293,7 @@ QList AppsModel::mappedRoles(const QList &sourceRoles) const QString AppsModel::normalizedDesktopId(const QString &sourceId) { - if (sourceId.isEmpty() || sourceId.endsWith(QLatin1String(".desktop")) || sourceId.startsWith(QLatin1String("internal/"))) + if (sourceId.isEmpty() || sourceId.startsWith(QLatin1String("internal/"))) return sourceId; return sourceId + QStringLiteral(".desktop"); } diff --git a/tests/searchfilterproxymodeltest.cpp b/tests/searchfilterproxymodeltest.cpp index 16552c84..06fa5695 100644 --- a/tests/searchfilterproxymodeltest.cpp +++ b/tests/searchfilterproxymodeltest.cpp @@ -382,16 +382,16 @@ void TestSearchFilterProxyModel::testSharedModelAdapter() QCOMPARE(appsModel.indexFromDesktopId("org.test.hidden.desktop").data(AppsModel::DesktopIdRole).toString(), QStringLiteral("org.test.hidden")); - auto suffixedItem = createTestAppItem("org.test.suffixed.desktop", "Suffixed", "Suffixed"); + auto suffixedItem = createTestAppItem("org.test.suffixed", "Suffixed", "Suffixed"); m_sourceModel.appendRow(suffixedItem); QCOMPARE(rowsInsertedSpy.count(), 2); const QModelIndex suffixedIndex = appsModel.indexFromDesktopId("org.test.suffixed"); QCOMPARE(suffixedIndex.data(AppsModel::DesktopIdRole).toString(), - QStringLiteral("org.test.suffixed.desktop")); + QStringLiteral("org.test.suffixed")); QSignalSpy dataChangedSpy(&appsModel, &QAbstractItemModel::dataChanged); suffixedItem->setData(QStringLiteral("Renamed"), SourceNameRole); - QCOMPARE(appsModel.indexFromDesktopId("org.test.suffixed.desktop").data(Qt::DisplayRole).toString(), + QCOMPARE(appsModel.indexFromDesktopId("org.test.suffixed").data(Qt::DisplayRole).toString(), QStringLiteral("Renamed")); QVERIFY(!dataChangedSpy.isEmpty()); const auto changedRoles = dataChangedSpy.constLast().at(2).value>();