Changeset View
Changeset View
Standalone View
Standalone View
containmentactions/contextmenu/menu.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 133 | if (!c->wallpaper().isEmpty()) { | |||
---|---|---|---|---|---|
137 | } | 137 | } | ||
138 | } | 138 | } | ||
139 | } else if (QAction *a = action(name)) { | 139 | } else if (QAction *a = action(name)) { | ||
140 | // Bug 364292: show "Remove this Panel" option only when panelcontroller is opened | 140 | // Bug 364292: show "Remove this Panel" option only when panelcontroller is opened | ||
141 | if (name != QLatin1String("remove") || c->isUserConfiguring() || | 141 | if (name != QLatin1String("remove") || c->isUserConfiguring() || | ||
142 | (c->containmentType() != Plasma::Types::PanelContainment | 142 | (c->containmentType() != Plasma::Types::PanelContainment | ||
143 | && c->containmentType() != Plasma::Types::CustomPanelContainment)) { | 143 | && c->containmentType() != Plasma::Types::CustomPanelContainment)) { | ||
144 | 144 | | |||
145 | if (name != QLatin1String("lock widgets") || c->corona()->immutability() != Plasma::Types::Mutable) { | ||||
145 | actions << a; | 146 | actions << a; | ||
broulik: Please avoid negating entire boolean statements.
Instead of `!(foo && bar)` use `!foo || !bar` | |||||
146 | } | 147 | } | ||
147 | } | 148 | } | ||
148 | } | 149 | } | ||
150 | } | ||||
149 | 151 | | |||
150 | return actions; | 152 | return actions; | ||
151 | } | 153 | } | ||
152 | 154 | | |||
153 | QAction *ContextMenu::action(const QString &name) | 155 | QAction *ContextMenu::action(const QString &name) | ||
154 | { | 156 | { | ||
155 | Plasma::Containment *c = containment(); | 157 | Plasma::Containment *c = containment(); | ||
156 | Q_ASSERT(c); | 158 | Q_ASSERT(c); | ||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |
Please avoid negating entire boolean statements.
Instead of !(foo && bar) use !foo || !bar