Drop obsolete version checks

Frameworks already require Qt 5.5.0.

REVIEW: 128985
wilder
Heiko Becker 10 years ago
parent d541fcc7bf
commit ed9e2553a9
  1. 6
      autotests/klinkitemselectionmodeltest.cpp
  2. 15
      autotests/kselectionproxymodeltest.cpp
  3. 4
      src/klinkitemselectionmodel.cpp
  4. 2
      src/kselectionproxymodel.cpp

@ -108,7 +108,6 @@ void KLinkItemSelectionModelTest::testSubSetCurrent()
void KLinkItemSelectionModelTest::testChangeModel()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
QVERIFY(m_mainSelectionModel->selection().isEmpty());
{
@ -130,12 +129,10 @@ void KLinkItemSelectionModelTest::testChangeModel()
QVERIFY(m_mainSelectionModel->selection().isEmpty());
QVERIFY(m_subSelectionModel->selection().isEmpty());
#endif
}
void KLinkItemSelectionModelTest::testChangeModelOfExternal()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
QVERIFY(m_mainSelectionModel->selection().isEmpty());
{
@ -157,7 +154,6 @@ void KLinkItemSelectionModelTest::testChangeModelOfExternal()
QVERIFY(m_mainSelectionModel->selection().isEmpty());
QVERIFY(m_subSelectionModel->selection().isEmpty());
#endif
}
void KLinkItemSelectionModelTest::testChangeLinkedSelectionModel()
@ -190,7 +186,6 @@ void KLinkItemSelectionModelTest::testChangeLinkedSelectionModel()
void KLinkItemSelectionModelTest::testAdditionalLink()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
{
auto idx = m_mainModel->index(6, 0);
m_mainSelectionModel->select(idx, QItemSelectionModel::Select);
@ -229,7 +224,6 @@ void KLinkItemSelectionModelTest::testAdditionalLink()
QVERIFY(!m_subSelectionModel->selection().isEmpty());
QCOMPARE(m_mainSelectionModel->selection().indexes().first().row(), 7);
QCOMPARE(m_subSelectionModel->selection().indexes().first().row(), 2);
#endif
}
void KLinkItemSelectionModelTest::testClearSelection()

@ -54,11 +54,9 @@ private Q_SLOTS:
void removeRows_data();
void removeRows();
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
void selectionModelModelChange();
void deselection_data();
void deselection();
#endif
private:
const QStringList days;
@ -122,7 +120,6 @@ void KSelectionProxyModelTest::selectOnSourceReset()
QVERIFY(selectionModel.selection().contains(strings.index(2, 0)));
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
void KSelectionProxyModelTest::selectionModelModelChange()
{
QStringListModel strings(days);
@ -382,8 +379,6 @@ void KSelectionProxyModelTest::deselection()
QCOMPARE(proxy.rowCount(), expectedRowCountAfter);
}
#endif
void KSelectionProxyModelTest::removeRows_data()
{
QTest::addColumn<int>("kspm_mode");
@ -842,11 +837,7 @@ void KSelectionProxyModelTest::removeRows()
);
resetCommand.doCommand();
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
QItemSelectionModel selectionModel;
#else
QItemSelectionModel selectionModel(&tree);
#endif
if (emulateSingleSelectionMode)
{
@ -866,19 +857,13 @@ void KSelectionProxyModelTest::removeRows()
proxy.setFilterBehavior(static_cast<KSelectionProxyModel::FilterBehavior>(kspm_mode));
if (connectSelectionModelFirst) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
selectionModel.setModel(&tree);
#endif
proxy.setSourceModel(&tree);
proxy.setSelectionModel(&selectionModel);
} else {
proxy.setSourceModel(&tree);
proxy.setSelectionModel(&selectionModel);
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
selectionModel.setModel(&tree);
#else
QSKIP("No QItemSelectionModel::setModel in Qt 5.4", SkipSingle);
#endif
}
QSignalSpy beforeSpy(&proxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));

@ -40,11 +40,9 @@ public:
QObject::connect(q_ptr, &QItemSelectionModel::currentChanged, q_ptr,
[this](const QModelIndex& idx) { slotCurrentChanged(idx); } );
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
QObject::connect(q_ptr, &QItemSelectionModel::modelChanged, q_ptr, [this] {
reinitializeIndexMapper();
});
#endif
}
Q_DECLARE_PUBLIC(KLinkItemSelectionModel)
@ -126,11 +124,9 @@ void KLinkItemSelectionModel::setLinkedItemSelectionModel(QItemSelectionModel *s
connect(d->m_linkedItemSelectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(sourceSelectionChanged(QItemSelection,QItemSelection)));
connect(d->m_linkedItemSelectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(sourceCurrentChanged(QModelIndex)));
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
connect(d->m_linkedItemSelectionModel, &QItemSelectionModel::modelChanged, this, [this] {
d_ptr->reinitializeIndexMapper();
});
#endif
}
d->reinitializeIndexMapper();
Q_EMIT linkedItemSelectionModelChanged();

@ -2407,10 +2407,8 @@ void KSelectionProxyModel::setSelectionModel(QItemSelectionModel *itemSelectionM
}
endResetModel();
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
connect(d->m_selectionModel.data(), &QItemSelectionModel::modelChanged,
this, handleSelectionModelModel);
#endif
handleSelectionModelModel();
}

Loading…
Cancel
Save