Commit b4d98e03 authored by David Faure's avatar David Faure
Browse files

Repair tagmodeltest, which requires these Q_PRIVATE_SLOT declarations

This is a (very) partial revert of commit b5a23bfe ("clazy fixes")
parent 7c6c2b97
Pipeline #30649 passed with stage
in 34 minutes and 44 seconds
......@@ -48,13 +48,16 @@ void FakeAkonadiServerCommand::connectForwardingSignals()
const auto *mo = FakeAkonadiServerCommand::metaObject();
for (int methodIndex = 0; methodIndex < mo->methodCount(); ++methodIndex) {
const QMetaMethod mm = mo->method(methodIndex);
QByteArray signature = mm.methodSignature();
const QByteArray signature = mm.methodSignature();
if (mm.methodType() == QMetaMethod::Signal) {
if ((qobject_cast<TagModel*>(m_model) && isTagSignal(signature)) ||
(qobject_cast<EntityTreeModel*>(m_model) && (isCollectionSignal(signature) || isItemSignal(signature))))
{
const int modelSlotIndex = m_model->metaObject()->indexOfSlot(signature.remove(0, 5).constData());
Q_ASSERT(modelSlotIndex >= 0);
const int modelSlotIndex = m_model->metaObject()->indexOfSlot(signature.mid(5).constData());
if (modelSlotIndex < 0) {
qWarning() << "Slot not found in" << m_model->metaObject()->className() << ":" << signature.mid(5).constData();
Q_ASSERT(modelSlotIndex >= 0);
}
mo->connect(this, methodIndex, m_model, modelSlotIndex);
}
}
......
......@@ -70,6 +70,11 @@ private:
bool insertColumns(int column, int count, const QModelIndex &index = QModelIndex()) override;
bool removeColumns(int column, int count, const QModelIndex &index = QModelIndex()) override;
bool removeRows(int row, int count, const QModelIndex &index = QModelIndex()) override;
// Used by FakeAkonadiServerCommand::connectForwardingSignals (tagmodeltest)
Q_PRIVATE_SLOT(d_func(), void tagsFetched(const Akonadi::Tag::List &tags))
Q_PRIVATE_SLOT(d_func(), void monitoredTagAdded(const Akonadi::Tag &tag))
Q_PRIVATE_SLOT(d_func(), void monitoredTagRemoved(const Akonadi::Tag &tag))
Q_PRIVATE_SLOT(d_func(), void monitoredTagChanged(const Akonadi::Tag &tag))
};
}
......
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