Rename indexforEventId to indexForEventId

This is a simple change to ensure its properly camelCase.
This commit is contained in:
Joshua Goins
2026-01-11 17:20:35 -05:00
parent b45967508c
commit 58b47b8711
6 changed files with 8 additions and 6 deletions

View File

@@ -208,7 +208,7 @@ void TimelineMessageModelTest::idToRow()
auto room = new TestUtils::TestRoom(connection, u"#myroom:kde.org"_s, u"test-min-sync.json"_s);
model->setRoom(room);
QCOMPARE(model->indexforEventId(u"$153456789:example.org"_s).row(), 0);
QCOMPARE(model->indexForEventId(u"$153456789:example.org"_s).row(), 0);
}
void TimelineMessageModelTest::cleanup()

View File

@@ -40,7 +40,7 @@ QQC2.ScrollView {
* @brief Shift the view to the given event ID.
*/
function goToEvent(eventId) {
const index = messageListView.model.indexforEventId(eventId)
const index = messageListView.model.indexForEventId(eventId)
if (!index.valid) {
messageListView.positionViewAtEnd();
return;

View File

@@ -125,7 +125,7 @@ QHash<int, QByteArray> MessageFilterModel::roleNames() const
return roles;
}
QModelIndex MessageFilterModel::indexforEventId(const QString &eventId) const
QModelIndex MessageFilterModel::indexForEventId(const QString &eventId) const
{
// Check if sourceModel is a message model.
auto messageModel = dynamic_cast<MessageModel *>(sourceModel());
@@ -141,7 +141,7 @@ QModelIndex MessageFilterModel::indexforEventId(const QString &eventId) const
}
}
auto eventIndex = messageModel->indexforEventId(eventId);
auto eventIndex = messageModel->indexForEventId(eventId);
if (!eventIndex.isValid()) {
return {};
}

View File

@@ -68,6 +68,7 @@ public:
* @brief Get the QModelIndex the given event ID in the model.
*/
Q_INVOKABLE QModelIndex indexforEventId(const QString &eventId) const;
Q_INVOKABLE QModelIndex indexForEventId(const QString &eventId) const;
static void setShowAllEvents(bool enabled);
static void setShowDeletedMessages(bool enabled);

View File

@@ -349,7 +349,7 @@ QHash<int, QByteArray> MessageModel::roleNames() const
return roles;
}
QModelIndex MessageModel::indexforEventId(const QString &eventId) const
QModelIndex MessageModel::indexForEventId(const QString &eventId) const
{
if (m_room == nullptr) {
return {};

View File

@@ -113,9 +113,10 @@ public:
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
/**
* @brief Get the QModelIndex of the given event ID in the model.
* @brief Get the QModelIndex of the given event ID in the model, returning an invalid QModelIndex if no matches were found.
*/
Q_INVOKABLE QModelIndex indexforEventId(const QString &eventId) const;
Q_INVOKABLE QModelIndex indexForEventId(const QString &eventId) const;
static void setHiddenFilter(std::function<bool(const Quotient::RoomEvent *)> hiddenFilter);