diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-21 17:09:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-21 17:09:34 +0300 |
commit | 12aa166ab2c280b1b8cf4d8507512c750a587de1 (patch) | |
tree | d86aaa3dd022a13e7c9e77b7db468ad260bdf634 /src | |
parent | 4d2f4fab80174f6ab5e730b62fdf7abda015768b (diff) |
code cleaning
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdfile/src/ftmanager.cpp | 2 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/popupOption.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/db.cpp | 10 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/core/stdfile/src/ftmanager.cpp b/src/core/stdfile/src/ftmanager.cpp index 56b0a168a7..10f4215c63 100644 --- a/src/core/stdfile/src/ftmanager.cpp +++ b/src/core/stdfile/src/ftmanager.cpp @@ -143,7 +143,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_FT_REMOVE:
for (auto &it : dat->arWindows)
if (it->hwnd == (HWND)lParam) {
- dat->arWindows.remove(dat->arWindows.indexOf(&it));
+ dat->arWindows.removeItem(&it);
break;
}
LayoutTransfers(hwnd, dat);
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 30792d9244..96d15c8805 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -122,8 +122,7 @@ class CUserInfoDlg : public CDlgBase if (!it->pDialog->IsEmpty())
continue;
- delete it;
- items.remove(items.indexOf(&it));
+ delete items.removeItem(&it);
}
if (items.getCount() == 0)
diff --git a/src/mir_app/src/popupOption.cpp b/src/mir_app/src/popupOption.cpp index 4ac5290c6d..a2b2f9a60a 100644 --- a/src/mir_app/src/popupOption.cpp +++ b/src/mir_app/src/popupOption.cpp @@ -64,7 +64,7 @@ void KillModulePopups(CMPluginBase *pPlugin) {
for (auto &it : g_arOptions.rev_iter())
if (it->m_plugin == pPlugin)
- g_arOptions.remove(g_arOptions.indexOf(&it));
+ g_arOptions.removeItem(&it);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 63afe4d66b..737fdd84b9 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -443,14 +443,18 @@ MIR_CORE_DLL(MEVENT) db_event_last(MCONTACT hContact) MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent, bool bFromServer)
{
if (g_pCurrDb == nullptr)
- return 0;
+ return 1;
if (!g_pCurrDb->MarkEventRead(hContact, hDbEvent))
- return 0;
+ return 1;
if (!bFromServer)
- if (auto *ppro = Proto_GetInstance(hContact))
+ if (auto *ppro = Proto_GetInstance(hContact)) {
ppro->OnMarkRead(hContact, hDbEvent);
+ return 0;
+ }
+
+ return 1;
}
MIR_CORE_DLL(MEVENT) db_event_next(MCONTACT hContact, MEVENT hDbEvent)
|