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/RemovePersonalSettings | |
parent | 2b30685427500c9eedac4c0c4862b32af144a90c (diff) |
simple database event cycles moved to cursors
Diffstat (limited to 'plugins/RemovePersonalSettings')
-rw-r--r-- | plugins/RemovePersonalSettings/src/rps.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 4b274a6a9a..91a1c56cd8 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -363,17 +363,13 @@ void RemoveUsers() hContact = db_find_first();
while (hContact != NULL) {
db_delete_contact(hContact);
-
hContact = db_find_first();
}
- // Delete events for contacts not in list
- MEVENT hDbEvent = db_event_first(0);
-
- while (hDbEvent != NULL) {
- db_event_delete(hDbEvent);
- hDbEvent = db_event_first(0);
- }
+ // Delete events from system history
+ DB::ECPTR pCursor(DB::Events(0));
+ while (pCursor.FetchNext())
+ pCursor.DeleteEvent();
// Now delete groups
DeleteSettingEx("CListGroups", nullptr);
|