force icon themes explicitly via new testing helper function
REVIEW: 127954
This commit is contained in:
parent
4883c580f9
commit
6ad988cb3d
@ -73,13 +73,7 @@ void IconItemTest::initTestCase()
|
|||||||
QIcon::setThemeSearchPaths({QFINDTESTDATA("data/icons")});
|
QIcon::setThemeSearchPaths({QFINDTESTDATA("data/icons")});
|
||||||
QIcon::setThemeName("test-theme");
|
QIcon::setThemeName("test-theme");
|
||||||
|
|
||||||
KConfigGroup cg(KSharedConfig::openConfig(), "Icons");
|
KIconTheme::forceThemeForTests("test-theme");
|
||||||
cg.writeEntry("Theme", "test-theme");
|
|
||||||
KConfigGroup plasmaConfig(KSharedConfig::openConfig("plasmarc"), "Theme");
|
|
||||||
plasmaConfig.writeEntry("name", "default");
|
|
||||||
|
|
||||||
cg.sync(); // sync explicitly so it will be correctly parsed
|
|
||||||
KSharedConfig::openConfig()->reparseConfiguration();
|
|
||||||
KIconTheme::reconfigure();
|
KIconTheme::reconfigure();
|
||||||
KIconLoader::global()->reconfigure(QString());
|
KIconLoader::global()->reconfigure(QString());
|
||||||
|
|
||||||
|
@ -47,13 +47,11 @@ void ThemeTest::initTestCase()
|
|||||||
|
|
||||||
QIcon::setThemeSearchPaths(QStringList()<<QFINDTESTDATA("data/icons"));
|
QIcon::setThemeSearchPaths(QStringList()<<QFINDTESTDATA("data/icons"));
|
||||||
|
|
||||||
KConfigGroup cg(KSharedConfig::openConfig("kdeglobals"), "Icons");
|
|
||||||
cg.writeEntry("Theme", "test-theme");
|
|
||||||
KConfigGroup plasmaConfig(KSharedConfig::openConfig("plasmarc"), "Theme");
|
KConfigGroup plasmaConfig(KSharedConfig::openConfig("plasmarc"), "Theme");
|
||||||
plasmaConfig.writeEntry("name", "default");
|
plasmaConfig.writeEntry("name", "default");
|
||||||
m_svg = new Plasma::Svg();
|
m_svg = new Plasma::Svg();
|
||||||
|
|
||||||
cg.sync(); // sync explicitly so it will be correctly parsed
|
KIconTheme::forceThemeForTests("test-theme");
|
||||||
KSharedConfig::openConfig()->reparseConfiguration();
|
KSharedConfig::openConfig()->reparseConfiguration();
|
||||||
KIconTheme::reconfigure();
|
KIconTheme::reconfigure();
|
||||||
KIconLoader::global()->reconfigure(QString());
|
KIconLoader::global()->reconfigure(QString());
|
||||||
@ -89,9 +87,7 @@ void ThemeTest::loadSvgIcon()
|
|||||||
QSignalSpy spy(m_svg, SIGNAL(repaintNeeded()));
|
QSignalSpy spy(m_svg, SIGNAL(repaintNeeded()));
|
||||||
QVERIFY(spy.isValid());
|
QVERIFY(spy.isValid());
|
||||||
|
|
||||||
KConfigGroup cg(KSharedConfig::openConfig("kdeglobals"), "Icons");
|
KIconTheme::forceThemeForTests("test-theme-two");
|
||||||
cg.writeEntry("Theme", "test-theme-two");
|
|
||||||
cg.sync();
|
|
||||||
// KIconloader needs changesto be emitted manually, ouch.
|
// KIconloader needs changesto be emitted manually, ouch.
|
||||||
for (int i=0; i < KIconLoader::LastGroup; i++) {
|
for (int i=0; i < KIconLoader::LastGroup; i++) {
|
||||||
KIconLoader::emitChange(KIconLoader::Group(i));
|
KIconLoader::emitChange(KIconLoader::Group(i));
|
||||||
|
Loading…
Reference in New Issue
Block a user