Prefer inner scopes

Don't request data until we're going to use it.
Don't emit about config changes if config doesn't change
This commit is contained in:
Aleix Pol 2014-07-08 01:47:26 +02:00
parent 0dba9044bf
commit 596dc7523d

View File

@ -563,13 +563,13 @@ void Containment::reactToScreenChange()
{
int newScreen = screen();
KConfigGroup c = config();
if (newScreen >= 0) {
d->lastScreen = newScreen;
KConfigGroup c = config();
c.writeEntry("lastScreen", d->lastScreen);
emit configNeedsSaving();
}
emit configNeedsSaving();
emit screenChanged(newScreen);
}