diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-09 23:02:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-09 23:02:26 +0000 |
commit | f59c5ef32703780535d23e6c770a02d9140d8b1e (patch) | |
tree | 9b3481abc8f5c968d158c0ff0be64c0d3efb7397 /plugins/Clist_modern | |
parent | 6a92c3c124f9fecf0c95bbce979fc8f7a37f5f4d (diff) |
crazy little thing called clist_modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@11312 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 41 |
2 files changed, 18 insertions, 25 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9e8c698f7e..b02851a82c 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -216,10 +216,8 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
}
else if (pcli->pfnGetProtocolVisibility(szChangedProto)) {
- int avg = pcli->pfnGetAverageMode(NULL);
int i = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL, szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0)), szChangedProto);
if (i < 0) {
- Netlib_Logf(NULL, "Connection icon disabled for %s", szChangedProto);
pcli->pfnTrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
return -1;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index e82c8e053b..1e4e682571 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -49,12 +49,7 @@ struct PROTOTICKS HIMAGELIST himlIconList;
};
-static int CompareTicks(const PROTOTICKS *p1, const PROTOTICKS *p2)
-{
- return mir_strcmp(p1->szProto, p2->szProto);
-}
-
-static OBJLIST<PROTOTICKS> arTicks(1, CompareTicks);
+static OBJLIST<PROTOTICKS> arTicks(1);
int ContactSettingChanged(WPARAM, LPARAM);
int MetaStatusChanged(WPARAM, LPARAM);
@@ -1032,7 +1027,7 @@ static bool StartTicksTimer(PROTOTICKS *pt) DestroyIcon(ic);
}
}
- CLUI_SafeSetTimer(pcli->hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, (int)(nAnimatedIconStep) / 1, 0);
+ CLUI_SafeSetTimer(pcli->hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, 0);
pt->bTimerCreated = 1;
pt->nCycleStartTick = GetTickCount();
return true;
@@ -2041,23 +2036,23 @@ LRESULT CLUI::OnSetFocus(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam)
{
- int status;
-
for (int i = 0; i < arTicks.getCount(); i++) {
PROTOTICKS *pt = &arTicks[i];
- if (pt->bTimerCreated) {
- if (pt->bGlobal)
- status = g_bMultiConnectionMode ? ID_STATUS_CONNECTING : 0;
- else
- status = CallProtoService(pt->szProto, PS_GETSTATUS, 0, 0);
-
- if (!(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
- pt->nCycleStartTick = 0;
- ImageList_Destroy(pt->himlIconList);
- pt->himlIconList = NULL;
- KillTimer(m_hWnd, TM_STATUSBARUPDATE + pt->nIndex);
- pt->bTimerCreated = 0;
- }
+ if (!pt->bTimerCreated)
+ continue;
+
+ int status;
+ if (pt->bGlobal)
+ status = g_bMultiConnectionMode ? ID_STATUS_CONNECTING : 0;
+ else
+ status = CallProtoService(pt->szProto, PS_GETSTATUS, 0, 0);
+
+ if (!(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
+ pt->nCycleStartTick = 0;
+ ImageList_Destroy(pt->himlIconList);
+ pt->himlIconList = NULL;
+ KillTimer(m_hWnd, TM_STATUSBARUPDATE + pt->nIndex);
+ pt->bTimerCreated = 0;
}
}
@@ -2167,7 +2162,7 @@ LRESULT CLUI::OnTimer(UINT msg, WPARAM wParam, LPARAM lParam) if (MirandaExiting())
return FALSE;
- if ((int)wParam >= TM_STATUSBARUPDATE && (int)wParam <= TM_STATUSBARUPDATE + 64) {
+ if (wParam >= TM_STATUSBARUPDATE && wParam <= TM_STATUSBARUPDATE + 64) {
if (!pcli->hwndStatus)
return FALSE;
return OnStatusBarUpdateTimer(msg, wParam, lParam);
|