Call initScript in wallpaper init, otherwise initWallpaper might be called before initScript.
svn path=/trunk/KDE/kdelibs/; revision=1050504
This commit is contained in:
parent
8d4cd6f3b3
commit
6fa744bb10
@ -58,6 +58,7 @@ public:
|
||||
bool cacheRendering : 1;
|
||||
bool initialized : 1;
|
||||
bool needsConfig : 1;
|
||||
bool scriptInitialized : 1;
|
||||
};
|
||||
|
||||
} // namespace Plasma
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user