Fix minor EBN issues and typos

wilder
Yuri Chornoivan 7 years ago
parent 232897a602
commit aefb80e112
  1. 2
      autotests/kdescendantsproxymodeltest.cpp
  2. 20
      autotests/proxymodeltestsuite/proxymodeltest.cpp
  3. 4
      autotests/proxymodeltestsuite/proxymodeltest.h
  4. 5
      autotests/test_model_helpers.h
  5. 4
      src/kbreadcrumbselectionmodel.h
  6. 2
      src/kselectionproxymodel.cpp
  7. 4
      tests/proxymodeltestapp/breadcrumbswidget.h
  8. 2
      tests/proxymodeltestapp/kreparentingproxymodel.cpp
  9. 4
      tests/proxymodeltestapp/recursivefilterpmwidget.h

@ -130,7 +130,7 @@ void tst_KDescendantProxyModel::testChangeSeparator()
delete model1; 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 /// emit data changed signals, since the data isn't changed
void tst_KDescendantProxyModel::testChangeInvisibleSeparator() void tst_KDescendantProxyModel::testChangeInvisibleSeparator()
{ {

@ -189,7 +189,7 @@ void ProxyModelTest::handleSignal(QVariantList expected)
QVariantList result = getResultSignal(); QVariantList result = getResultSignal();
QCOMPARE(result.takeAt(0).toInt(), signalType); 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) { switch (signalType) {
case RowsAboutToBeInserted: case RowsAboutToBeInserted:
case RowsInserted: case RowsInserted:
@ -577,7 +577,7 @@ void ProxyModelTest::doTest()
const bool isLayoutChange = signalList.contains(QVariantList() << LayoutAboutToBeChanged); const bool isLayoutChange = signalList.contains(QVariantList() << LayoutAboutToBeChanged);
while (!signalList.isEmpty()) { 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); QVariantList expected = signalList.takeAt(0);
handleSignal(expected); handleSignal(expected);
} }
@ -641,9 +641,9 @@ void ProxyModelTest::doTest()
m_modelSpy->clearTestData(); m_modelSpy->clearTestData();
} }
void ProxyModelTest::connectTestSignals(QObject *reciever) void ProxyModelTest::connectTestSignals(QObject *receiver)
{ {
if (!reciever) { if (!receiver) {
return; return;
} }
for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) { for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) {
@ -651,16 +651,16 @@ void ProxyModelTest::connectTestSignals(QObject *reciever)
if (mm.methodType() == QMetaMethod::Signal if (mm.methodType() == QMetaMethod::Signal
&& QString(mm.methodSignature()).startsWith(QLatin1String("test")) && QString(mm.methodSignature()).startsWith(QLatin1String("test"))
&& QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) { && QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) {
int slotIndex = reciever->metaObject()->indexOfSlot(mm.methodSignature()); int slotIndex = receiver->metaObject()->indexOfSlot(mm.methodSignature());
Q_ASSERT(slotIndex >= 0); 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; return;
} }
for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) { for (int methodIndex = 0; methodIndex < metaObject()->methodCount(); ++methodIndex) {
@ -668,9 +668,9 @@ void ProxyModelTest::disconnectTestSignals(QObject *reciever)
if (mm.methodType() == QMetaMethod::Signal if (mm.methodType() == QMetaMethod::Signal
&& QString(mm.methodSignature()).startsWith(QLatin1String("test")) && QString(mm.methodSignature()).startsWith(QLatin1String("test"))
&& QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) { && QString(mm.methodSignature()).endsWith(QLatin1String("Data()"))) {
int slotIndex = reciever->metaObject()->indexOfSlot(mm.methodSignature()); int slotIndex = receiver->metaObject()->indexOfSlot(mm.methodSignature());
Q_ASSERT(slotIndex >= 0); Q_ASSERT(slotIndex >= 0);
metaObject()->disconnect(this, methodIndex, reciever, slotIndex); metaObject()->disconnect(this, methodIndex, receiver, slotIndex);
} }
} }
} }

@ -326,8 +326,8 @@ private Q_SLOTS:
} }
protected: protected:
void connectTestSignals(QObject *reciever); void connectTestSignals(QObject *receiver);
void disconnectTestSignals(QObject *reciever); void disconnectTestSignals(QObject *receiver);
void connectProxy(QAbstractProxyModel *proxyModel); void connectProxy(QAbstractProxyModel *proxyModel);
void doTestMappings(const QModelIndex &parent); void doTestMappings(const QModelIndex &parent);

@ -18,6 +18,9 @@
02110-1301, USA. 02110-1301, USA.
*/ */
#ifndef TEST_MODEL_HELPERS_H
#define TEST_MODEL_HELPERS_H
#include <QString> #include <QString>
#include <QStandardItem> #include <QStandardItem>
#include <QSignalSpy> #include <QSignalSpy>
@ -76,4 +79,4 @@ inline QString rowSpyToText(const QSignalSpy &spy)
} }
} }
#endif

@ -19,8 +19,8 @@
02110-1301, USA. 02110-1301, USA.
*/ */
#ifndef KBREADCRUMBSPROXYMODEL_H #ifndef KBREADCRUMBSELECTIONMODEL_H
#define KBREADCRUMBSPROXYMODEL_H #define KBREADCRUMBSELECTIONMODEL_H
#include <QItemSelectionModel> #include <QItemSelectionModel>
#include <QAbstractItemModel> #include <QAbstractItemModel>

@ -1667,7 +1667,7 @@ void KSelectionProxyModelPrivate::removeParentMappings(const QModelIndex &parent
if (proxyGrandParent == parent) { if (proxyGrandParent == parent) {
if (!flatList) if (!flatList)
// Due to recursive calls, we could have several iterators on the container // 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); removeParentMappings(it.key(), 0, q->sourceModel()->rowCount(it.value()) - 1);
} }

@ -19,8 +19,8 @@
02110-1301, USA. 02110-1301, USA.
*/ */
#ifndef BREADCRUBS_WIDGET_H #ifndef BREADCRUMBS_WIDGET_H
#define BREADCRUBS_WIDGET_H #define BREADCRUMBS_WIDGET_H
#include <QWidget> #include <QWidget>
#include <QItemSelection> #include <QItemSelection>

@ -821,7 +821,7 @@ void KReparentingProxyModelPrivate::handleInsertion(const PendingInsertion &pend
QHash<QModelIndex, QModelIndexList> newItemMappings = recreateMappings(parent, start, end, KReparentingProxyModelPrivate::MapDescendants); QHash<QModelIndex, QModelIndexList> newItemMappings = recreateMappings(parent, start, end, KReparentingProxyModelPrivate::MapDescendants);
// iterate over keys. if key in keys iterate up. This gives list of top level parents. // 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) // 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. // That case should work too.

@ -19,8 +19,8 @@
* 02110-1301 USA * 02110-1301 USA
*/ */
#ifndef RECURSIVE_PM_WIDGET_H #ifndef RECURSIVE_FILTER_PM_WIDGET_H
#define RECURSIVE_PM_WIDGET_H #define RECURSIVE_FILTER_PM_WIDGET_H
#include <QWidget> #include <QWidget>
#include <QRegExp> #include <QRegExp>

Loading…
Cancel
Save