Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/models/appsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ QList<int> AppsModel::mappedRoles(const QList<int> &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");
}
Expand Down
6 changes: 3 additions & 3 deletions tests/searchfilterproxymodeltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QList<int>>();
Expand Down
Loading