summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-27 09:46:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-27 09:46:10 +0000
commitf77b70a84c4609b9fef4a5e4a497f5845541c2de (patch)
tree990ac025853d3afa56332c3866700fb9ac98ab46
parentd6d476f3efae48e36ce1c7d3f1ec6f656ff14331 (diff)
pfnSetHideOffline -> strict prototype
git-svn-id: http://svn.miranda-ng.org/main/trunk@16770 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_clistint.h2
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp2
-rw-r--r--src/mir_app/src/clc.h6
-rw-r--r--src/mir_app/src/clistmod.cpp2
-rw-r--r--src/mir_app/src/cluiservices.cpp3
-rw-r--r--src/mir_app/src/contact.cpp19
6 files changed, 17 insertions, 17 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h
index 23a415f7f3..a4a705c368 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -390,7 +390,7 @@ struct CLIST_INTERFACE
void (*pfnChangeContactIcon)(MCONTACT hContact, int iIcon);
void (*pfnLoadContactTree)(void);
int (*pfnCompareContacts)(const ClcContact *contact1, const ClcContact *contact2);
- int (*pfnSetHideOffline)(WPARAM wParam, LPARAM lParam);
+ int (*pfnSetHideOffline)(int newValue); // TRUE, FALSE or -1 to revert the current setting
/* docking.c */
int (*pfnDocking_ProcessWindowMessage)(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 24cdcb0a96..f7dc4aa4fb 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -158,7 +158,7 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2)
INT_PTR ToggleHideOffline(WPARAM, LPARAM)
{
- return pcli->pfnSetHideOffline((WPARAM)-1, 0);
+ return pcli->pfnSetHideOffline(-1);
}
INT_PTR ToggleGroups(WPARAM, LPARAM)
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index 3d41d0931b..52e78bee00 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -187,15 +187,11 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon);
/* contact.c */
void fnChangeContactIcon(MCONTACT hContact, int iIcon);
void fnLoadContactTree(void);
-int fnSetHideOffline(WPARAM wParam, LPARAM lParam);
+int fnSetHideOffline(int iValue);
/* docking.c */
int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
-/* group.c */
-TCHAR* fnGetGroupName(MGROUP idx, DWORD *pdwFlags);
-int fnRenameGroup(MGROUP groupID, const TCHAR *newName);
-
/* keyboard.c */
int fnHotKeysRegister(HWND hwnd);
void fnHotKeysUnregister(HWND hwnd);
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index 5ae1741942..9ea47517ce 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -411,7 +411,7 @@ static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam)
/***************************************************************************************/
static INT_PTR ShowHideStub(WPARAM wParam, LPARAM lParam) { return cli.pfnShowHide(wParam, lParam); }
-static INT_PTR SetHideOfflineStub(WPARAM wParam, LPARAM lParam) { return cli.pfnSetHideOffline(wParam, lParam); }
+static INT_PTR SetHideOfflineStub(WPARAM wParam, LPARAM) { return cli.pfnSetHideOffline((int)wParam); }
static INT_PTR Docking_ProcessWindowMessageStub(WPARAM wParam, LPARAM lParam) { return cli.pfnDocking_ProcessWindowMessage(wParam, lParam); }
static INT_PTR HotkeysProcessMessageStub(WPARAM wParam, LPARAM lParam) { return cli.pfnHotkeysProcessMessage(wParam, lParam); }
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp
index 094535bcf5..867187129f 100644
--- a/src/mir_app/src/cluiservices.cpp
+++ b/src/mir_app/src/cluiservices.cpp
@@ -41,6 +41,9 @@ EXTERN_C MIR_APP_DLL(void) Clist_GroupAdded(MGROUP hGroup)
EXTERN_C MIR_APP_DLL(void) Clist_EndRebuild(void)
{
+ if (cli.hwndContactTree == NULL)
+ return;
+
bool bRebuild = false;
LONG_PTR dwStyle = GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE);
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp
index ac1d01ab73..ceedd7a125 100644
--- a/src/mir_app/src/contact.cpp
+++ b/src/mir_app/src/contact.cpp
@@ -61,19 +61,20 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam)
return 0;
}
-int fnSetHideOffline(WPARAM wParam, LPARAM)
+int fnSetHideOffline(int iValue)
{
- switch ((int)wParam) {
+ if (iValue == -1) // invert the current value
+ iValue = !db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+
+ switch (iValue) {
case 0:
- db_set_b(NULL, "CList", "HideOffline", 0);
- break;
case 1:
- db_set_b(NULL, "CList", "HideOffline", 1);
- break;
- case -1:
- db_set_b(NULL, "CList", "HideOffline", !db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ db_set_b(NULL, "CList", "HideOffline", iValue);
break;
+
+ default:
+ return -1;
}
cli.pfnLoadContactTree();
- return 0;
+ return iValue;
}