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 | // Only show "Unlock Widgets" in the UI, not "Lock Widgets" | ||||
146 | if (!(name == QLatin1String("lock widgets") && c->corona()->immutability() == Plasma::Types::Mutable)) { | ||||
broulik: Please avoid negating entire boolean statements.
Instead of `!(foo && bar)` use `!foo || !bar` | |||||
145 | actions << a; | 147 | actions << a; | ||
146 | } | 148 | } | ||
147 | } | 149 | } | ||
148 | } | 150 | } | ||
151 | } | ||||
149 | 152 | | |||
150 | return actions; | 153 | return actions; | ||
151 | } | 154 | } | ||
152 | 155 | | |||
153 | QAction *ContextMenu::action(const QString &name) | 156 | QAction *ContextMenu::action(const QString &name) | ||
154 | { | 157 | { | ||
155 | Plasma::Containment *c = containment(); | 158 | Plasma::Containment *c = containment(); | ||
156 | Q_ASSERT(c); | 159 | Q_ASSERT(c); | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Please avoid negating entire boolean statements.
Instead of !(foo && bar) use !foo || !bar