#include <QGraphicsSceneMouseEvent>
#include <QSignalSpy>
#include <QProxyStyle>
+#include <QStandardPaths>
/**
* \class KItemListControllerTestStyle is a proxy style for testing the
{
Q_OBJECT
-private slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
*/
void KItemListControllerTest::initTestCase()
{
+ QStandardPaths::setTestModeEnabled(true);
qRegisterMetaType<KItemSet>("KItemSet");
m_testDir = new TestDir();
groupingEnabledList.append(true);
groupingEnabledNames[true] = "grouping enabled";
- foreach (const KFileItemListView::ItemLayout& layout, layoutList) {
+ for (const KFileItemListView::ItemLayout& layout : layoutList) {
// The following settings depend on the layout.
// Note that 'columns' are actually 'rows' in
// Compact layout.
break;
}
- foreach (int columnCount, columnCountList) {
- foreach (const KItemListController::SelectionBehavior& selectionBehavior, selectionBehaviorList) {
- foreach (bool groupingEnabled, groupingEnabledList) { // krazy:exclude=foreach
+ for (int columnCount : qAsConst(columnCountList)) {
+ for (const KItemListController::SelectionBehavior& selectionBehavior : qAsConst(selectionBehaviorList)) {
+ for (bool groupingEnabled : qAsConst(groupingEnabledList)) {
QList<QPair<KeyPress, ViewState> > testList;
// First, key presses which should have the same effect
<< qMakePair(KeyPress(Qt::Key_Enter), ViewState(0, KItemSet(), true))
<< qMakePair(KeyPress(Qt::Key_Space, Qt::ControlModifier), ViewState(0, KItemSet() << 0))
<< qMakePair(KeyPress(Qt::Key_Space, Qt::ControlModifier), ViewState(0, KItemSet()))
- << qMakePair(KeyPress(Qt::Key_Space), ViewState(0, KItemSet() << 0))
+ << qMakePair(KeyPress(Qt::Key_Space), ViewState(0, KItemSet())) // This used to select, but we are now using it to trigger either
+ // selection mode or "QuickLook". Ctrl+Space still works for selecting as expected.
<< qMakePair(KeyPress(Qt::Key_E), ViewState(13, KItemSet() << 13))
<< qMakePair(KeyPress(Qt::Key_Space), ViewState(14, KItemSet() << 14))
<< qMakePair(KeyPress(Qt::Key_3), ViewState(15, KItemSet() << 15))