From aefb80e112f0367b14e2310673503e64d09ec46d Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Mon, 22 Oct 2018 19:14:43 +0300 Subject: [PATCH] Fix minor EBN issues and typos --- autotests/kdescendantsproxymodeltest.cpp | 2 +- .../proxymodeltestsuite/proxymodeltest.cpp | 20 +++++++++---------- .../proxymodeltestsuite/proxymodeltest.h | 4 ++-- autotests/test_model_helpers.h | 5 ++++- src/kbreadcrumbselectionmodel.h | 4 ++-- src/kselectionproxymodel.cpp | 2 +- tests/proxymodeltestapp/breadcrumbswidget.h | 4 ++-- .../kreparentingproxymodel.cpp | 2 +- .../recursivefilterpmwidget.h | 4 ++-- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/autotests/kdescendantsproxymodeltest.cpp b/autotests/kdescendantsproxymodeltest.cpp index f8b4535..9785293 100644 --- a/autotests/kdescendantsproxymodeltest.cpp +++ b/autotests/kdescendantsproxymodeltest.cpp @@ -130,7 +130,7 @@ void tst_KDescendantProxyModel::testChangeSeparator() delete model1; } -/// tests that change seperator that is not shown does not change the content and does not +/// tests that change separator that is not shown does not change the content and does not /// emit data changed signals, since the data isn't changed void tst_KDescendantProxyModel::testChangeInvisibleSeparator() { diff --git a/autotests/proxymodeltestsuite/proxymodeltest.cpp b/autotests/proxymodeltestsuite/proxymodeltest.cpp index cc32466..0f34733 100644 --- a/autotests/proxymodeltestsuite/proxymodeltest.cpp +++ b/autotests/proxymodeltestsuite/proxymodeltest.cpp @@ -189,7 +189,7 @@ void ProxyModelTest::handleSignal(QVariantList expected) QVariantList result = getResultSignal(); QCOMPARE(result.takeAt(0).toInt(), signalType); - // Check that the signal we expected to recieve was emitted exactly. + // Check that the signal we expected to receive was emitted exactly. switch (signalType) { case RowsAboutToBeInserted: case RowsInserted: @@ -577,7 +577,7 @@ void ProxyModelTest::doTest() const bool isLayoutChange = signalList.contains(QVariantList() << LayoutAboutToBeChanged); while (!signalList.isEmpty()) { - // Process each signal we recieved as a result of running the test. + // Process each signal we received as a result of running the test. QVariantList expected = signalList.takeAt(0); handleSignal(expected); } @@ -641,9 +641,9 @@ void ProxyModelTest::doTest() m_modelSpy->clearTestData(); } -void ProxyModelTest::connectTestSignals(QObject *reciever) +void ProxyModelTest::connectTestSignals(QObject *receiver) { - if (!reciever) { + if (!receiver) { return; } for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) { @@ -651,16 +651,16 @@ void ProxyModelTest::connectTestSignals(QObject *reciever) if (mm.methodType() == QMetaMethod::Signal && QString(mm.methodSignature()).startsWith(QLatin1String("test")) && QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) { - int slotIndex = reciever->metaObject()->indexOfSlot(mm.methodSignature()); + int slotIndex = receiver->metaObject()->indexOfSlot(mm.methodSignature()); Q_ASSERT(slotIndex >= 0); - metaObject()->connect(this, methodIndex, reciever, slotIndex); + metaObject()->connect(this, methodIndex, receiver, slotIndex); } } } -void ProxyModelTest::disconnectTestSignals(QObject *reciever) +void ProxyModelTest::disconnectTestSignals(QObject *receiver) { - if (!reciever) { + if (!receiver) { return; } for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) { @@ -668,9 +668,9 @@ void ProxyModelTest::disconnectTestSignals(QObject *reciever) if (mm.methodType() == QMetaMethod::Signal && QString(mm.methodSignature()).startsWith(QLatin1String("test")) && QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) { - int slotIndex = reciever->metaObject()->indexOfSlot(mm.methodSignature()); + int slotIndex = receiver->metaObject()->indexOfSlot(mm.methodSignature()); Q_ASSERT(slotIndex >= 0); - metaObject()->disconnect(this, methodIndex, reciever, slotIndex); + metaObject()->disconnect(this, methodIndex, receiver, slotIndex); } } } diff --git a/autotests/proxymodeltestsuite/proxymodeltest.h b/autotests/proxymodeltestsuite/proxymodeltest.h index 222673f..0c92bba 100644 --- a/autotests/proxymodeltestsuite/proxymodeltest.h +++ b/autotests/proxymodeltestsuite/proxymodeltest.h @@ -326,8 +326,8 @@ private Q_SLOTS: } protected: - void connectTestSignals(QObject *reciever); - void disconnectTestSignals(QObject *reciever); + void connectTestSignals(QObject *receiver); + void disconnectTestSignals(QObject *receiver); void connectProxy(QAbstractProxyModel *proxyModel); void doTestMappings(const QModelIndex &parent); diff --git a/autotests/test_model_helpers.h b/autotests/test_model_helpers.h index 6b25d91..c0485d0 100644 --- a/autotests/test_model_helpers.h +++ b/autotests/test_model_helpers.h @@ -18,6 +18,9 @@ 02110-1301, USA. */ +#ifndef TEST_MODEL_HELPERS_H +#define TEST_MODEL_HELPERS_H + #include #include #include @@ -76,4 +79,4 @@ inline QString rowSpyToText(const QSignalSpy &spy) } } - +#endif diff --git a/src/kbreadcrumbselectionmodel.h b/src/kbreadcrumbselectionmodel.h index 31bc361..0880e4d 100644 --- a/src/kbreadcrumbselectionmodel.h +++ b/src/kbreadcrumbselectionmodel.h @@ -19,8 +19,8 @@ 02110-1301, USA. */ -#ifndef KBREADCRUMBSPROXYMODEL_H -#define KBREADCRUMBSPROXYMODEL_H +#ifndef KBREADCRUMBSELECTIONMODEL_H +#define KBREADCRUMBSELECTIONMODEL_H #include #include diff --git a/src/kselectionproxymodel.cpp b/src/kselectionproxymodel.cpp index 60bc45a..de0571a 100644 --- a/src/kselectionproxymodel.cpp +++ b/src/kselectionproxymodel.cpp @@ -1667,7 +1667,7 @@ void KSelectionProxyModelPrivate::removeParentMappings(const QModelIndex &parent if (proxyGrandParent == parent) { if (!flatList) // Due to recursive calls, we could have several iterators on the container - // when erase is called. That's safe accoring to the QHash::iterator docs though. + // when erase is called. That's safe according to the QHash::iterator docs though. { removeParentMappings(it.key(), 0, q->sourceModel()->rowCount(it.value()) - 1); } diff --git a/tests/proxymodeltestapp/breadcrumbswidget.h b/tests/proxymodeltestapp/breadcrumbswidget.h index 6cae220..4bb23f6 100644 --- a/tests/proxymodeltestapp/breadcrumbswidget.h +++ b/tests/proxymodeltestapp/breadcrumbswidget.h @@ -19,8 +19,8 @@ 02110-1301, USA. */ -#ifndef BREADCRUBS_WIDGET_H -#define BREADCRUBS_WIDGET_H +#ifndef BREADCRUMBS_WIDGET_H +#define BREADCRUMBS_WIDGET_H #include #include diff --git a/tests/proxymodeltestapp/kreparentingproxymodel.cpp b/tests/proxymodeltestapp/kreparentingproxymodel.cpp index 1a32c5c..4493565 100644 --- a/tests/proxymodeltestapp/kreparentingproxymodel.cpp +++ b/tests/proxymodeltestapp/kreparentingproxymodel.cpp @@ -821,7 +821,7 @@ void KReparentingProxyModelPrivate::handleInsertion(const PendingInsertion &pend QHash newItemMappings = recreateMappings(parent, start, end, KReparentingProxyModelPrivate::MapDescendants); // iterate over keys. if key in keys iterate up. This gives list of top level parents. - // Pick the one whoes parent is @p parent. Insert it. Look up until find the parent of another one and insert that. + // Pick the one whose parent is @p parent. Insert it. Look up until find the parent of another one and insert that. // If one of the parents is invalid it is necessarily the last one to be processed (if there are more to process, they'll be children of it) // That case should work too. diff --git a/tests/proxymodeltestapp/recursivefilterpmwidget.h b/tests/proxymodeltestapp/recursivefilterpmwidget.h index d4ece17..2911f24 100644 --- a/tests/proxymodeltestapp/recursivefilterpmwidget.h +++ b/tests/proxymodeltestapp/recursivefilterpmwidget.h @@ -19,8 +19,8 @@ * 02110-1301 USA */ -#ifndef RECURSIVE_PM_WIDGET_H -#define RECURSIVE_PM_WIDGET_H +#ifndef RECURSIVE_FILTER_PM_WIDGET_H +#define RECURSIVE_FILTER_PM_WIDGET_H #include #include