diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-04-09 21:04:12 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-04-09 21:04:12 +0000 |
commit | 57c3fea94d824bdcad55626b0a352aad8ffa8cfd (patch) | |
tree | f6749a0954962d7ee8120a381580159adb080626 /plugins/Nudge/src | |
parent | 22d948a4cd28ccf08008db597e4f7470c3a57219 (diff) |
Nudge:
- Minor optimisation
git-svn-id: http://svn.miranda-ng.org/main/trunk@12719 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Nudge/src')
-rw-r--r-- | plugins/Nudge/src/main.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index a4c3b2143b..a9fa60ccf9 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -31,15 +31,19 @@ PLUGININFOEX pluginInfo = { INT_PTR NudgeShowMenu(WPARAM wParam, LPARAM lParam)
{
- bool bEnabled = false;
-
- for (int i = 0; i < arNudges.getCount(); i++) {
- CNudgeElement &p = arNudges[i];
- if (!strcmp((char*)wParam, p.ProtocolName)) {
- bEnabled = GlobalNudge.useByProtocol ? p.enabled : DefaultNudge.enabled;
- break;
+ bool bEnabled;
+ if (GlobalNudge.useByProtocol) {
+ bEnabled = false;
+ for (int i = 0; i < arNudges.getCount(); i++) {
+ CNudgeElement &p = arNudges[i];
+ if (!strcmp((char*)wParam, p.ProtocolName)) {
+ bEnabled = p.enabled;
+ break;
+ }
}
}
+ else
+ bEnabled = DefaultNudge.enabled;
Menu_ShowItem(g_hContactMenu, bEnabled && lParam != 0);
return 0;
|