Call initScript in wallpaper init, otherwise initWallpaper might be called before initScript.

svn path=/trunk/KDE/kdelibs/; revision=1050504
This commit is contained in:
Petri Damstén 2009-11-17 13:29:40 +00:00
parent 8d4cd6f3b3
commit 6fa744bb10
2 changed files with 6 additions and 4 deletions

View File

@ -58,6 +58,7 @@ public:
bool cacheRendering : 1;
bool initialized : 1;
bool needsConfig : 1;
bool scriptInitialized : 1;
};
} // namespace Plasma

View File

@ -268,6 +268,7 @@ void Wallpaper::restore(const KConfigGroup &config)
void Wallpaper::init(const KConfigGroup &config)
{
if (d->script) {
d->initScript();
d->script->initWallpaper(config);
}
}
@ -398,7 +399,8 @@ WallpaperPrivate::WallpaperPrivate(KService::Ptr service, Wallpaper *wallpaper)
script(0),
cacheRendering(false),
initialized(false),
needsConfig(false)
needsConfig(false),
scriptInitialized(false)
{
if (wallpaperDescription.isValid()) {
QString api = wallpaperDescription.property("X-Plasma-API").toString();
@ -417,8 +419,6 @@ WallpaperPrivate::WallpaperPrivate(KService::Ptr service, Wallpaper *wallpaper)
<< wallpaperDescription.name() << "Wallpaper.";
delete package;
package = 0;
} else {
QTimer::singleShot(0, q, SLOT(initScript()));
}
}
}
@ -475,9 +475,10 @@ void WallpaperPrivate::setupScriptSupport()
void WallpaperPrivate::initScript()
{
if (script) {
if (script && !scriptInitialized) {
setupScriptSupport();
script->init();
scriptInitialized = true;
}
}