From c28759e7c9e63b1d092904b4299afdffec91bcdf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2018 17:55:24 +0300 Subject: new functions to access mirandaboot.ini from all plugins: Profile_GetSetting() - reads a string from mirandaboot.ini Profile_GetSettingInt() - reads an integer from mirandaboot.ini --- src/mir_core/src/langpack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index bb4ff63b9d..22c19a8552 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -637,9 +637,8 @@ void GetDefaultLang() PathToAbsoluteW(L".", g_tszRoot); // look into mirandaboot.ini - wchar_t tszPath[MAX_PATH], tszLangName[256]; - PathToAbsoluteW(L"\\mirandaboot.ini", tszPath); - GetPrivateProfileString(L"Language", L"DefaultLanguage", L"", tszLangName, _countof(tszLangName), tszPath); + wchar_t tszLangName[256]; + Profile_GetSetting(L"Language/DefaultLanguage", tszLangName); if (tszLangName[0]) { if (!mir_wstrcmpi(tszLangName, L"default")) { db_set_ws(NULL, "Langpack", "Current", L"default"); @@ -652,6 +651,7 @@ void GetDefaultLang() } // try to load langpack that matches UserDefaultUILanguage + wchar_t tszPath[MAX_PATH]; if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) { mir_snwprintf(tszPath, L"langpack_%s.txt", wcslwr(tszLangName)); if (!LoadLangPack(tszPath)) { -- cgit v1.2.3