From 18f7e9261c885e953f220ba6836e8bca43a6fc88 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Apr 2016 13:40:58 +0000 Subject: contact list groups: - finally database is not used anymore (only as a settings' storage); - MGROUP type introduced to replace HANDLE for group ids; - MS_CLIST_GROUP* services became Clist_Group* functions; - CLIST_INTERFACE members pfnGetGroupName & pfnRenameGroup also transformed into static Clist_Group* functions git-svn-id: http://svn.miranda-ng.org/main/trunk@16659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/ExportImport.cpp | 30 ++++++++--------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'plugins/NewsAggregator/Src') diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 45aac14986..7f2f403941 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -139,12 +139,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM parent = xmlGetParent(parent); } - TCHAR *utfgroup = NULL; + TCHAR *ptszGroup = NULL; if (group) { - utfgroup = mir_utf8decodeT(_T2A(group)); - if ( !utfgroup) { + ptszGroup = mir_utf8decodeT(_T2A(group)); + if ( !ptszGroup) { isGroupUTF = false; - utfgroup = group; + ptszGroup = group; } else isGroupUTF = 1; } @@ -158,26 +158,12 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM db_set_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME); db_set_ts(hContact, MODULE, "MsgFormat", TAGSDEFAULT); db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0)); - if (utfgroup) { - db_set_ts(hContact, "CList", "Group", utfgroup); - int hGroup = 1; - char *group_name; - BYTE GroupExist = 0; - do { - group_name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0); - if (group_name != NULL && !mir_strcmp(group_name, _T2A(utfgroup))) { - GroupExist = 1; - break; - } - hGroup++; - } - while (group_name); - - if(!GroupExist) - CallService(MS_CLIST_GROUPCREATE, 0, (LPARAM)utfgroup); + if (ptszGroup) { + db_set_ts(hContact, "CList", "Group", ptszGroup); + Clist_GroupCreate(0, ptszGroup); } if (isGroupUTF) - mir_free(utfgroup); + mir_free(ptszGroup); } if (isTextUTF) mir_free(text); -- cgit v1.2.3