[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdelibs/plasma
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2010-02-16 6:47:37
Message-ID: 1266302857.968203.30849.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1090828 by aseigo:

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


 M  +22 -19    applet.cpp  


--- branches/KDE/4.4/kdelibs/plasma/applet.cpp #1090827:1090828
@@ -1712,6 +1712,7 @@
         return;
     }
 
+    d->publishUI.publishCheckbox = 0;
     if (d->package && d->configLoader) {
         KConfigDialog *dialog = 0;
 
@@ -1878,29 +1879,31 @@
     }
 
 #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()) {
-        QString resourceName =
-        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());
-        q->publish(Plasma::ZeroconfAnnouncement, resourceName);
-        if (publishUI.allUsersCheckbox->isChecked()) {
-            if (!AuthorizationManager::self()->d->matchingRule(resourceName, \
                Credentials())) {
-                AuthorizationRule *rule = new AuthorizationRule(resourceName, "");
-                rule->setPolicy(AuthorizationRule::Allow);
-                rule->setTargets(AuthorizationRule::AllUsers);
-                AuthorizationManager::self()->d->rules.append(rule);
+        if (publishUI.publishCheckbox->isChecked()) {
+            QString resourceName =
+                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()); +            q->publish(Plasma::ZeroconfAnnouncement, \
resourceName); +            if (publishUI.allUsersCheckbox->isChecked()) {
+                if (!AuthorizationManager::self()->d->matchingRule(resourceName, \
Credentials())) { +                    AuthorizationRule *rule = new \
AuthorizationRule(resourceName, ""); +                    \
rule->setPolicy(AuthorizationRule::Allow); +                    \
rule->setTargets(AuthorizationRule::AllUsers); +                    \
AuthorizationManager::self()->d->rules.append(rule); +                }
+            } else {
+                AuthorizationRule *matchingRule =
+                    AuthorizationManager::self()->d->matchingRule(resourceName, \
Credentials()); +                if (matchingRule) {
+                    AuthorizationManager::self()->d->rules.removeAll(matchingRule);
+                }
             }
         } else {
-            AuthorizationRule *matchingRule =
-                AuthorizationManager::self()->d->matchingRule(resourceName, \
                Credentials());
-            if (matchingRule) {
-                AuthorizationManager::self()->d->rules.removeAll(matchingRule);
-            }
+            q->unpublish();
         }
-    } else {
-        q->unpublish();
     }
 #endif
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic