in case a script engine does not add the standard pages (which is a bug in the script engine), at least don't crash
BUG:226823 svn path=/branches/KDE/4.4/kdelibs/; revision=1090828
This commit is contained in:
parent
70185eba03
commit
2c84f169a1
41
applet.cpp
41
applet.cpp
@ -1712,6 +1712,7 @@ void Applet::showConfigurationInterface()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d->publishUI.publishCheckbox = 0;
|
||||||
if (d->package && d->configLoader) {
|
if (d->package && d->configLoader) {
|
||||||
KConfigDialog *dialog = 0;
|
KConfigDialog *dialog = 0;
|
||||||
|
|
||||||
@ -1878,29 +1879,31 @@ void AppletPrivate::configDialogFinished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_REMOTE_WIDGETS
|
#ifdef ENABLE_REMOTE_WIDGETS
|
||||||
q->config().writeEntry("Share", publishUI.publishCheckbox->isChecked());
|
if (publishUI.publishCheckbox) {
|
||||||
|
q->config().writeEntry("Share", publishUI.publishCheckbox->isChecked());
|
||||||
|
|
||||||
if (publishUI.publishCheckbox->isChecked()) {
|
if (publishUI.publishCheckbox->isChecked()) {
|
||||||
QString resourceName =
|
QString resourceName =
|
||||||
i18nc("%1 is the name of a plasmoid, %2 the name of the machine that plasmoid is published on",
|
i18nc("%1 is the name of a plasmoid, %2 the name of the machine that plasmoid is published on",
|
||||||
"%1 on %2", q->name(), QHostInfo::localHostName());
|
"%1 on %2", q->name(), QHostInfo::localHostName());
|
||||||
q->publish(Plasma::ZeroconfAnnouncement, resourceName);
|
q->publish(Plasma::ZeroconfAnnouncement, resourceName);
|
||||||
if (publishUI.allUsersCheckbox->isChecked()) {
|
if (publishUI.allUsersCheckbox->isChecked()) {
|
||||||
if (!AuthorizationManager::self()->d->matchingRule(resourceName, Credentials())) {
|
if (!AuthorizationManager::self()->d->matchingRule(resourceName, Credentials())) {
|
||||||
AuthorizationRule *rule = new AuthorizationRule(resourceName, "");
|
AuthorizationRule *rule = new AuthorizationRule(resourceName, "");
|
||||||
rule->setPolicy(AuthorizationRule::Allow);
|
rule->setPolicy(AuthorizationRule::Allow);
|
||||||
rule->setTargets(AuthorizationRule::AllUsers);
|
rule->setTargets(AuthorizationRule::AllUsers);
|
||||||
AuthorizationManager::self()->d->rules.append(rule);
|
AuthorizationManager::self()->d->rules.append(rule);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AuthorizationRule *matchingRule =
|
||||||
|
AuthorizationManager::self()->d->matchingRule(resourceName, Credentials());
|
||||||
|
if (matchingRule) {
|
||||||
|
AuthorizationManager::self()->d->rules.removeAll(matchingRule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AuthorizationRule *matchingRule =
|
q->unpublish();
|
||||||
AuthorizationManager::self()->d->matchingRule(resourceName, Credentials());
|
|
||||||
if (matchingRule) {
|
|
||||||
AuthorizationManager::self()->d->rules.removeAll(matchingRule);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
q->unpublish();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user