From 355c41643beadff74d490dc36f2c0432a2286e4c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 24 Nov 2017 13:15:32 +0300 Subject: more common database code moved to MDatabaseCommon --- src/mir_core/src/db.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 15e9f2465d..7aa591db19 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -45,23 +45,9 @@ MIR_CORE_DLL(MIDatabase*) db_get_current() return currDb; } -static int sttEnumVars(const char *szVarName, void *param) -{ - LIST* vars = (LIST*)param; - vars->insert(mir_strdup(szVarName)); - return 0; -} - MIR_CORE_DLL(int) db_delete_module(MCONTACT hContact, const char *szModuleName) { - LIST vars(20); - db_enum_settings(hContact, sttEnumVars, szModuleName, &vars); - - for (int i = vars.getCount() - 1; i >= 0; i--) { - db_unset(hContact, szModuleName, vars[i]); - mir_free(vars[i]); - } - return 0; + return (currDb) ? currDb->DeleteModule(hContact, szModuleName) : 0; } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3