diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-21 20:01:52 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-21 20:01:52 +0000 |
commit | 4955a3b835c8b6d71fa836cdfc0ec5b82fa59ae0 (patch) | |
tree | 3229191afdf997f55a69f9deee2ec399dafe8f44 /src/modules/langpack | |
parent | 85b429453559d86491ac428a1028cbe4d5b382c9 (diff) |
fixed langpack authors crop
git-svn-id: http://svn.miranda-ng.org/main/trunk@9548 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/langpack')
-rw-r--r-- | src/modules/langpack/langpack.cpp | 19 | ||||
-rw-r--r-- | src/modules/langpack/langpack.h | 4 | ||||
-rw-r--r-- | src/modules/langpack/lpopts.cpp | 21 |
3 files changed, 19 insertions, 25 deletions
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp index 728e48db43..33a52b53d0 100644 --- a/src/modules/langpack/langpack.cpp +++ b/src/modules/langpack/langpack.cpp @@ -35,22 +35,21 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) /* language folder */
ptrT langpack(db_get_tsa(NULL, "Langpack", "Current"));
-
- LANGPACK_INFO pack;
- PathToAbsoluteT(_T("\\Languages\\langpack_*.txt"), pack.tszFullPath);
+
+ TCHAR tszFullPath[MAX_PATH];
+ PathToAbsoluteT(_T("\\Languages\\langpack_*.txt"), tszFullPath);
BOOL fPackFound = FALSE;
WIN32_FIND_DATA wfd;
- HANDLE hFind = FindFirstFile(pack.tszFullPath, &wfd);
+ HANDLE hFind = FindFirstFile(tszFullPath, &wfd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
/* get data */
- TCHAR tszFullPath[MAX_PATH];
PathToAbsoluteT(_T("\\Languages\\"), tszFullPath);
lstrcat(tszFullPath, wfd.cFileName);
- ZeroMemory(&pack, sizeof(pack));
+ LANGPACK_INFO pack;
if (!LoadLangPackDescr(tszFullPath, &pack)) {
pack.ftFileDate = wfd.ftLastWriteTime;
/* enabled? */
@@ -68,13 +67,13 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) /* default langpack: English */
if (callback != NULL) {
- ZeroMemory(&pack, sizeof(pack));
+ LANGPACK_INFO pack;
pack.Locale = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
lstrcpy(pack.tszLanguage, _T("English"));
- lstrcpyA(pack.szAuthors, "Miranda NG Development Team");
- lstrcpyA(pack.szAuthorEmail, "project-info@miranda-ng.org");
+ pack.szAuthors = "Miranda NG Development Team";
+ pack.szAuthorEmail = "project-info@miranda-ng.org";
DWORD v = CallService(MS_SYSTEM_GETVERSION, 0, 0);
- mir_snprintf(pack.szLastModifiedUsing, sizeof(pack.szLastModifiedUsing), "%d.%d.%d", ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF));
+ pack.szLastModifiedUsing.Format("%d.%d.%d", ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF));
/* file date */
if (GetModuleFileName(NULL, pack.tszFullPath, SIZEOF(pack.tszFullPath))) {
lstrcpy(pack.tszFileName, _tcsrchr(pack.tszFullPath, '\\') + 1);
diff --git a/src/modules/langpack/langpack.h b/src/modules/langpack/langpack.h index 137fabc245..b39f03215d 100644 --- a/src/modules/langpack/langpack.h +++ b/src/modules/langpack/langpack.h @@ -45,9 +45,7 @@ struct LANGPACK_INFO TCHAR tszLanguage[64];
LCID Locale;
WORD codepage;
- char szAuthors[2048];
- char szAuthorEmail[128];
- char szLastModifiedUsing[64];
+ CMStringA szAuthors, szAuthorEmail, szLastModifiedUsing;
FILETIME ftFileDate;
TCHAR tszFileName[MAX_PATH]; /* just the file name itself */
TCHAR tszFullPath[MAX_PATH]; /* full path to the langpack */
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp index d0258dde6b..b1c11ae665 100644 --- a/src/modules/langpack/lpopts.cpp +++ b/src/modules/langpack/lpopts.cpp @@ -72,9 +72,8 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lParam)
{
- LANGPACK_INFO *pack2 = (LANGPACK_INFO*)mir_alloc(sizeof(LANGPACK_INFO));
- if (pack2 == NULL) return FALSE;
- CopyMemory(pack2, pack, sizeof(LANGPACK_INFO));
+ LANGPACK_INFO *pack2 = new LANGPACK_INFO();
+ *pack2 = *pack;
/* insert */
TCHAR tszName[512];
@@ -120,15 +119,6 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP EnumLangpacks(InsertPackItemEnumProc, (WPARAM)hwndList, (LPARAM)0);
return TRUE;
- case WM_DESTROY:
- {
- int count = ListBox_GetCount(hwndList);
- for (int i = 0; i < count; i++)
- mir_free((LANGPACK_INFO*)ListBox_GetItemData(hwndList, i));
- ComboBox_ResetContent(hwndList);
- }
- return TRUE;
-
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_LANGEMAIL:
@@ -194,6 +184,13 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
break;
+
+ case WM_DESTROY:
+ int count = ListBox_GetCount(hwndList);
+ for (int i = 0; i < count; i++)
+ delete (LANGPACK_INFO*)ListBox_GetItemData(hwndList, i);
+ ComboBox_ResetContent(hwndList);
+ return TRUE;
}
return FALSE;
}
|