From 4bc88d46fa9859615521f436511d4f102f20eb67 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Jul 2012 14:11:28 +0000 Subject: databases are still static, but are controlled via classes git-svn-id: http://svn.miranda-ng.org/main/trunk@1014 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/profilemanager.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/modules/database/profilemanager.cpp') diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index 63e6cd1c4d..4e8ebc381f 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -119,13 +119,11 @@ static int FindDbProviders(const TCHAR* tszProfileName, DATABASELINK *dblink, LP { HWND hwndDlg = (HWND)lParam; HWND hwndCombo = GetDlgItem(hwndDlg, IDC_PROFILEDRIVERS); - char szName[64]; + TCHAR szName[64]; if (dblink->getFriendlyName(szName, SIZEOF(szName), 1) == 0) { // add to combo box - TCHAR* p = Langpack_PcharToTchar(szName); - LRESULT index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)p); - mir_free(p); + LRESULT index = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)szName); SendMessage(hwndCombo, CB_SETITEMDATA, index, (LPARAM)dblink); } return DBPE_CONT; @@ -221,17 +219,12 @@ static INT_PTR CALLBACK DlgProfileNew(HWND hwndDlg, UINT msg, WPARAM wParam, LPA static int DetectDbProvider(const TCHAR*, DATABASELINK * dblink, LPARAM lParam) { int error; - - char* fullpath = makeFileName((TCHAR*)lParam); - - int ret = dblink->grokHeader(fullpath, &error); - mir_free(fullpath); + int ret = dblink->grokHeader((TCHAR*)lParam, &error); if (ret == 0) { - char tmp[ MAX_PATH ]; + TCHAR tmp[ MAX_PATH ]; dblink->getFriendlyName(tmp, SIZEOF(tmp), 1); - MultiByteToWideChar(CP_ACP, 0, tmp, -1, (TCHAR*)lParam, MAX_PATH); - + _tcsncpy((TCHAR*)lParam, tmp, MAX_PATH); return DBPE_HALT; } -- cgit v1.2.3