Changeset View
Changeset View
Standalone View
Standalone View
tests/configsavetest.cpp
Show All 10 Lines | |||||
11 | 11 | | |||
12 | ConfigSaveTest::ConfigSaveTest() | 12 | ConfigSaveTest::ConfigSaveTest() | ||
13 | { | 13 | { | ||
14 | QStandardPaths::setTestModeEnabled(true); | 14 | QStandardPaths::setTestModeEnabled(true); | ||
15 | } | 15 | } | ||
16 | 16 | | |||
17 | static void fillValues(QScopedPointer<AbstractAppearance>& a) | 17 | static void fillValues(QScopedPointer<AbstractAppearance>& a) | ||
18 | { | 18 | { | ||
19 | a->setFont("a"); | | |||
20 | a->setIcon("a"); | | |||
21 | a->setTheme("a"); | 19 | a->setTheme("a"); | ||
22 | a->setToolbarStyle("a"); | | |||
23 | a->setIconFallback("a"); | | |||
24 | a->setCursor("a"); | | |||
25 | a->setShowIconsInButtons(true); | | |||
26 | a->setShowIconsInMenus(true); | | |||
27 | a->setPrimaryButtonWarpsSlider(true); | 20 | a->setPrimaryButtonWarpsSlider(true); | ||
28 | 21 | | |||
29 | auto a3 = dynamic_cast<AppearanceGTK3*>(a.data()); | 22 | auto a3 = dynamic_cast<AppearanceGTK3*>(a.data()); | ||
30 | if (a3) { | 23 | if (a3) { | ||
31 | a3->setApplicationPreferDarkTheme(false); | 24 | a3->setApplicationPreferDarkTheme(false); | ||
32 | } | 25 | } | ||
33 | } | 26 | } | ||
34 | 27 | | |||
35 | void compareAppearances(QScopedPointer<AbstractAppearance>& reloaded, QScopedPointer<AbstractAppearance>& instance) | 28 | void compareAppearances(QScopedPointer<AbstractAppearance>& reloaded, QScopedPointer<AbstractAppearance>& instance) | ||
36 | { | 29 | { | ||
37 | QCOMPARE(reloaded->getFont(), instance->getFont()); | | |||
38 | QCOMPARE(reloaded->getIcon(), instance->getIcon()); | | |||
39 | QCOMPARE(reloaded->getTheme(), instance->getTheme()); | 30 | QCOMPARE(reloaded->getTheme(), instance->getTheme()); | ||
40 | QCOMPARE(reloaded->getCursor(), instance->getCursor()); | | |||
41 | QCOMPARE(reloaded->getToolbarStyle(), instance->getToolbarStyle()); | | |||
42 | QCOMPARE(reloaded->getIconFallback(), instance->getIconFallback()); | | |||
43 | QCOMPARE(reloaded->getShowIconsInButtons(), instance->getShowIconsInButtons()); | | |||
44 | QCOMPARE(reloaded->getShowIconsInMenus(), instance->getShowIconsInMenus()); | | |||
45 | QCOMPARE(reloaded->getPrimaryButtonWarpsSlider(), instance->getPrimaryButtonWarpsSlider()); | 31 | QCOMPARE(reloaded->getPrimaryButtonWarpsSlider(), instance->getPrimaryButtonWarpsSlider()); | ||
46 | } | 32 | } | ||
47 | 33 | | |||
48 | QByteArray readFile(const QString& path) | 34 | QByteArray readFile(const QString& path) | ||
49 | { | 35 | { | ||
50 | QFile f(path); | 36 | QFile f(path); | ||
51 | if(!f.open(QFile::ReadOnly | QFile::Text)) | 37 | if(!f.open(QFile::ReadOnly | QFile::Text)) | ||
52 | return QByteArray(); | 38 | return QByteArray(); | ||
Show All 35 Lines |