]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge remote-tracking branch 'origin/KDE/4.11'
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 9 Sep 2013 19:21:43 +0000 (21:21 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 9 Sep 2013 19:27:22 +0000 (21:27 +0200)
The most recent commit from the KDE/4.11 branch (new unit test) had to
be modified slightly due to the changed signal emission when resorting
the model changes only the groups, and not the order of the items
(groupsChaged instead of itemsMoved).

1  2 
src/dolphinviewcontainer.cpp
src/tests/kfileitemmodeltest.cpp

Simple merge
index 1d9646b3efb2a5175b71d41ceba21db3538a2bf8,b0a27cd01267628e0b7222ed1ffaedc782127df6..7979202469ca8b9a0e9bdec3e40c865f447d770d
@@@ -1286,6 -1246,24 +1286,24 @@@ void KFileItemModelTest::testNameRoleGr
      expectedGroups << QPair<int, QVariant>(2, QLatin1String("D"));
      expectedGroups << QPair<int, QVariant>(3, QLatin1String("E"));
      QCOMPARE(m_model->groups(), expectedGroups);
 -    QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)), DefaultTimeout));
+     // Change d.txt back to c.txt, but this time using the dir lister's refreshItems() signal.
+     const KFileItem fileItemD = m_model->fileItem(2);
+     KFileItem fileItemC = fileItemD;
+     KUrl urlC = fileItemC.url();
+     urlC.setFileName("c.txt");
+     fileItemC.setUrl(urlC);
+     m_model->slotRefreshItems(QList<QPair<KFileItem, KFileItem> >() << qMakePair(fileItemD, fileItemC));
++    QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(groupsChanged()), DefaultTimeout));
+     QCOMPARE(itemsInModel(), QStringList() << "a.txt" << "b.txt" << "c.txt" << "e.txt");
+     expectedGroups.clear();
+     expectedGroups << QPair<int, QVariant>(0, QLatin1String("A"));
+     expectedGroups << QPair<int, QVariant>(1, QLatin1String("B"));
+     expectedGroups << QPair<int, QVariant>(2, QLatin1String("C"));
+     expectedGroups << QPair<int, QVariant>(3, QLatin1String("E"));
+     QCOMPARE(m_model->groups(), expectedGroups);
  }
  
  QStringList KFileItemModelTest::itemsInModel() const