Changeset View
Changeset View
Standalone View
Standalone View
autotests/test_virtual_desktops.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 60 | private Q_SLOTS: | |||
---|---|---|---|---|---|
82 | void below(); | 82 | void below(); | ||
83 | void updateGrid_data(); | 83 | void updateGrid_data(); | ||
84 | void updateGrid(); | 84 | void updateGrid(); | ||
85 | void updateLayout_data(); | 85 | void updateLayout_data(); | ||
86 | void updateLayout(); | 86 | void updateLayout(); | ||
87 | void name_data(); | 87 | void name_data(); | ||
88 | void name(); | 88 | void name(); | ||
89 | void switchToShortcuts(); | 89 | void switchToShortcuts(); | ||
90 | void changeRows(); | ||||
90 | void load(); | 91 | void load(); | ||
91 | void save(); | 92 | void save(); | ||
92 | 93 | | |||
93 | private: | 94 | private: | ||
94 | void addDirectionColumns(); | 95 | void addDirectionColumns(); | ||
95 | template<typename T> | 96 | template<typename T> | ||
96 | void testDirection(const QString &actionName); | 97 | void testDirection(const QString &actionName); | ||
97 | }; | 98 | }; | ||
▲ Show 20 Lines • Show All 487 Lines • ▼ Show 20 Line(s) | 581 | for (uint i=1; i<=vds->maximum(); ++i) { | |||
585 | QCOMPARE(vds->current(), i); | 586 | QCOMPARE(vds->current(), i); | ||
586 | } | 587 | } | ||
587 | // invoke switchTo not from a QAction | 588 | // invoke switchTo not from a QAction | ||
588 | QMetaObject::invokeMethod(vds, "slotSwitchTo"); | 589 | QMetaObject::invokeMethod(vds, "slotSwitchTo"); | ||
589 | // should still be on max | 590 | // should still be on max | ||
590 | QCOMPARE(vds->current(), vds->maximum()); | 591 | QCOMPARE(vds->current(), vds->maximum()); | ||
591 | } | 592 | } | ||
592 | 593 | | |||
594 | void TestVirtualDesktops::changeRows() | ||||
595 | { | ||||
596 | VirtualDesktopManager *vds = VirtualDesktopManager::self(); | ||||
597 | | ||||
598 | vds->setCount(4); | ||||
599 | vds->setRows(4); | ||||
600 | QCOMPARE(vds->rows(), 4); | ||||
601 | | ||||
602 | vds->setRows(5); | ||||
603 | QCOMPARE(vds->rows(), 4); | ||||
604 | | ||||
605 | vds->setCount(2); | ||||
606 | QCOMPARE(vds->rows(), 2); | ||||
607 | } | ||||
608 | | ||||
593 | void TestVirtualDesktops::load() | 609 | void TestVirtualDesktops::load() | ||
594 | { | 610 | { | ||
595 | VirtualDesktopManager *vds = VirtualDesktopManager::self(); | 611 | VirtualDesktopManager *vds = VirtualDesktopManager::self(); | ||
596 | // no config yet, load should not change anything | 612 | // no config yet, load should not change anything | ||
597 | vds->load(); | 613 | vds->load(); | ||
598 | QCOMPARE(vds->count(), (uint)0); | 614 | QCOMPARE(vds->count(), (uint)0); | ||
599 | // empty config should create one desktop | 615 | // empty config should create one desktop | ||
600 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 616 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |