diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-06 20:38:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-06 20:38:53 +0000 |
commit | 83246d23d9e1c1feeaee267b9a1b68c4766e7114 (patch) | |
tree | c9160f63edd2f7dc85b61a0e1a987da5ce34f0d8 /plugins/NewXstatusNotify/main.cpp | |
parent | 01b90c2d693230916ebc4d868f5868c6e32b58a0 (diff) |
array fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@340 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/main.cpp')
-rw-r--r-- | plugins/NewXstatusNotify/main.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp index f1e34b53c7..033d89a45b 100644 --- a/plugins/NewXstatusNotify/main.cpp +++ b/plugins/NewXstatusNotify/main.cpp @@ -34,8 +34,8 @@ MM_INTERFACE mmi = {0}; UTF8_INTERFACE utfi = {0};
LIST_INTERFACE li = {0};
-SortedList *eventList;
-SortedList *xstatusList;
+LIST<DBEVENT> eventList( 10, 0 );
+LIST<XSTATUSCHANGE> xstatusList( 10, 0 );
HANDLE hEnableDisableMenu, hOptionsInitialize, hModulesLoaded, hUserInfoInitialise;
HANDLE hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged;
@@ -117,22 +117,20 @@ HANDLE GetIconHandle(char *szIcon) __inline void AddXSC(XSTATUSCHANGE *xsc)
{
- li.List_Insert(xstatusList, xsc, xstatusList->realCount);
+ xstatusList.insert(xsc);
}
__inline void RemoveXSC(XSTATUSCHANGE *xsc)
{
- int id = li.List_IndexOf(xstatusList, xsc);
+ int id = xstatusList.getIndex(xsc);
if (id != -1)
- li.List_Remove(xstatusList, id);
+ xstatusList.remove(id);
}
XSTATUSCHANGE *FindXSC(HANDLE hContact)
{
- XSTATUSCHANGE *xsc;
- for (int i = 0; i < xstatusList->realCount; i++)
- {
- xsc = (XSTATUSCHANGE *)xstatusList->items[i];
+ for (int i = 0; i < xstatusList.getCount(); i++) {
+ XSTATUSCHANGE* xsc = xstatusList[i];
if (xsc->hContact == hContact)
return xsc;
}
@@ -1383,9 +1381,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) InitMainMenuItem();
InitTopToolbar();
- eventList = li.List_Create(0, 10);
- xstatusList = li.List_Create(0, 10);
-
hUserInfoInitialise = HookEvent(ME_USERINFO_INITIALISE, UserInfoInitialise);
hContactStatusChanged = HookEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED, ContactStatusChanged);
hMessageWindowOpen = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
@@ -1439,11 +1434,6 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) extern "C" int __declspec(dllexport) Unload(void)
{
- li.List_Destroy(eventList);
- li.List_Destroy(xstatusList);
- mir_free(eventList);
- mir_free(xstatusList);
-
UnhookEvent(hContactSettingChanged);
UnhookEvent(hOptionsInitialize);
UnhookEvent(hModulesLoaded);
|