config ui of applets should work again

This commit is contained in:
Marco Martin 2013-04-25 11:43:00 +02:00
parent e7ca00e534
commit 4feb02c329
3 changed files with 12 additions and 14 deletions

View File

@ -109,7 +109,7 @@ void PlasmoidPackage::initPackage(Package *package)
package->setServicePrefix("plasma-applet-");
package->setDefaultPackageRoot("plasma/plasmoids/");
package->addFileDefinition("configmodel", "ui/config.qml", i18n("Configuration UI pages model"));
package->addFileDefinition("configmodel", "config/config.qml", i18n("Configuration UI pages model"));
package->addFileDefinition("mainconfigxml", "config/main.xml", i18n("Configuration XML file"));
}

View File

@ -99,13 +99,13 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper)
return;
}
if (m_containment->containment()->wallpaper() == wallpaper) {
if (m_containment->wallpaper() == wallpaper) {
delete m_currentWallpaperConfig;
if (m_containment->wallpaperInterface()) {
m_currentWallpaperConfig = m_containment->wallpaperInterface()->configuration();
}
} else {
if (m_containment->containment()->wallpaper() != m_currentWallpaper) {
if (m_containment->wallpaper() != m_currentWallpaper) {
delete m_currentWallpaperConfig;
}
@ -114,7 +114,7 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper)
pkg.setDefaultPackageRoot("plasma/wallpapers");
pkg.setPath(wallpaper);
QFile file(pkg.filePath("config", "main.xml"));
KConfigGroup cfg = m_containment->containment()->config();
KConfigGroup cfg = m_containment->config();
cfg = KConfigGroup(&cfg, "Wallpaper");
m_currentWallpaperConfig = new ConfigPropertyMap(new Plasma::ConfigLoader(&cfg, &file), this);
}*/
@ -126,9 +126,9 @@ void ContainmentConfigView::setCurrentWallpaper(const QString &wallpaper)
void ContainmentConfigView::applyWallpaper()
{
/*m_containment->containment()->setWallpaper(m_currentWallpaper);
m_containment->setWallpaper(m_currentWallpaper);
if (m_currentWallpaperConfig != m_containment->wallpaperInterface()->configuration()) {
/*if (m_currentWallpaperConfig != m_containment->wallpaperInterface()->configuration()) {
delete m_currentWallpaperConfig;
m_currentWallpaperConfig = m_containment->wallpaperInterface()->configuration();
emit wallpaperConfigurationChanged();

View File

@ -315,16 +315,14 @@ void DesktopCorona::showConfigurationInterface(Plasma::Applet *applet)
return;
}
if (!m_configView) {
Plasma::Containment *cont = qobject_cast<Plasma::Containment *>(applet);
Plasma::Containment *cont = qobject_cast<Plasma::Containment *>(applet);
if (cont) {
m_configView = new ContainmentConfigView(cont);
} else {
m_configView = new ConfigView(applet);
}
m_configView.data()->init();
if (cont) {
m_configView = new ContainmentConfigView(cont);
} else {
m_configView = new ConfigView(applet);
}
m_configView.data()->init();
m_configView.data()->show();
}