summaryrefslogtreecommitdiff
path: root/src/modules/langpack
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-08-08 19:55:34 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-08-08 19:55:34 +0000
commit39bd74cbd4d2dbe536d003c15d17f5eefd572394 (patch)
treef5c5f388eb6a85511edfb202fdff34ec36d2938b /src/modules/langpack
parentb452546a225e5c527a0380516440fd6b291a9463 (diff)
fixed writing current langpack in db
git-svn-id: http://svn.miranda-ng.org/main/trunk@10130 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/langpack')
-rw-r--r--src/modules/langpack/langpack.cpp2
-rw-r--r--src/modules/langpack/lpopts.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp
index 33a52b53d0..30f9f1dcf7 100644
--- a/src/modules/langpack/langpack.cpp
+++ b/src/modules/langpack/langpack.cpp
@@ -76,7 +76,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam)
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);
+ lstrcpy(pack.tszFileName, _T("default"));
HANDLE hFile = CreateFile(pack.tszFileName, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (hFile != INVALID_HANDLE_VALUE) {
GetFileTime(hFile, NULL, NULL, &pack.ftFileDate);
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp
index b1c11ae665..5ea238b859 100644
--- a/src/modules/langpack/lpopts.cpp
+++ b/src/modules/langpack/lpopts.cpp
@@ -166,7 +166,9 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
for (int i = 0; i < count; i++) {
LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, i);
if (i == idx) {
- db_set_ws(NULL, "Langpack", "Current", pack->tszFileName);
+ db_set_ts(NULL, "Langpack", "Current", pack->tszFileName);
+ PathToAbsoluteT(_T("\\mirandaboot.ini"), tszPath);
+ WritePrivateProfileString(_T("Language"), _T("DefaultLanguage"), pack->tszFileName, tszPath);
lstrcpy(tszPath, pack->tszFullPath);
pack->flags |= LPF_ENABLED;
}