Changeset View
Changeset View
Standalone View
Standalone View
src/core/autotests/accountschannelsmodeltest.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 46 | { | |||
---|---|---|---|---|---|
56 | Ruqola::self()->accountManager()->addAccount(acct); | 56 | Ruqola::self()->accountManager()->addAccount(acct); | ||
57 | const auto newAcctIndex = model.index(1, 0); | 57 | const auto newAcctIndex = model.index(1, 0); | ||
58 | QCOMPARE(model.rowCount(), 2); | 58 | QCOMPARE(model.rowCount(), 2); | ||
59 | QVERIFY(!model.hasChildren(newAcctIndex)); | 59 | QVERIFY(!model.hasChildren(newAcctIndex)); | ||
60 | QCOMPARE(model.data(newAcctIndex).toString(), QString()); | 60 | QCOMPARE(model.data(newAcctIndex).toString(), QString()); | ||
61 | acct->setAccountName(newAcctName); | 61 | acct->setAccountName(newAcctName); | ||
62 | QCOMPARE(model.data(newAcctIndex).toString(), newAcctName); | 62 | QCOMPARE(model.data(newAcctIndex).toString(), newAcctName); | ||
63 | 63 | | |||
64 | Ruqola::self()->setCurrentAccount(newAcctName); | 64 | Ruqola::self()->setCurrentAccount(newAcctName, false /*showLastRoom*/); | ||
65 | 65 | | |||
66 | const auto newRoomId = QStringLiteral("RoomId"); | 66 | const auto newRoomId = QStringLiteral("RoomId"); | ||
67 | const auto newRoomName = QStringLiteral("Room Name"); | 67 | const auto newRoomName = QStringLiteral("Room Name"); | ||
68 | acct->roomModel()->addRoom(newRoomId, newRoomName); | 68 | acct->roomModel()->addRoom(newRoomId, newRoomName); | ||
69 | QCOMPARE(model.rowCount(newAcctIndex), 0); // Room not yet open | 69 | QCOMPARE(model.rowCount(newAcctIndex), 0); // Room not yet open | ||
70 | 70 | | |||
71 | // FIXME: RoomModel should probably emit dataChanged to allow the sort/filter to update | 71 | // FIXME: RoomModel should probably emit dataChanged to allow the sort/filter to update | ||
72 | acct->roomModel()->findRoom(newRoomId)->setOpen(true); | 72 | acct->roomModel()->findRoom(newRoomId)->setOpen(true); | ||
Show All 16 Lines |