diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-14 12:34:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-14 12:34:32 +0300 |
commit | 5a09915186e4ae70cc39e9343ca02a1b860d7f94 (patch) | |
tree | ba115287c182bc8dae3308fc23f8d197d68850cb /plugins/AvatarHistory/src/AvatarDlg.cpp | |
parent | 2b30685427500c9eedac4c0c4862b32af144a90c (diff) |
simple database event cycles moved to cursors
Diffstat (limited to 'plugins/AvatarHistory/src/AvatarDlg.cpp')
-rw-r--r-- | plugins/AvatarHistory/src/AvatarDlg.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 8e696d6cf6..245c58005a 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -410,9 +410,10 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) int FillAvatarListFromDB(HWND list, MCONTACT hContact)
{
int max_pos = 0;
- BYTE blob[2048];
- for (MEVENT hDbEvent = db_event_first(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
+ DB::ECPTR pCursor(DB::Events(hContact));
+ while (MEVENT hDbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
+ BYTE blob[2048];
dbei.cbBlob = sizeof(blob);
dbei.pBlob = blob;
if (db_event_get(hDbEvent, &dbei) != 0) continue;
|