Minor fixes

This commit is contained in:
Birunthan Mohanathas 2012-06-19 17:33:11 +03:00
parent c9ae008cd7
commit 6456b6adb3
2 changed files with 32 additions and 31 deletions

View File

@ -937,11 +937,14 @@ void CDialogAbout::CTabPlugins::Initialize()
WIN32_FIND_DATA fd;
HANDLE hSearch = FindFirstFile(filter.c_str(), &fd);
if (hSearch == INVALID_HANDLE_VALUE)
{
return;
}
int index = 0;
do
{
if (hSearch == INVALID_HANDLE_VALUE) break; // No more files found
// Try to get the version and author
std::wstring tmpSz = path + fd.cFileName;
const WCHAR* path = tmpSz.c_str();

View File

@ -1583,15 +1583,14 @@ void CDialogManage::CTabSettings::Initialize()
// Scan for languages
HWND item = GetDlgItem(m_Window, IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX);
WIN32_FIND_DATA fd; // Data structure describes the file found
HANDLE hSearch; // Search handle returned by FindFirstFile
std::wstring files = Rainmeter->GetPath() + L"Languages\\*.dll";
hSearch = FindFirstFile(files.c_str(), &fd);
WIN32_FIND_DATA fd;
HANDLE hSearch = FindFirstFile(files.c_str(), &fd);
if (hSearch != INVALID_HANDLE_VALUE)
{
do
{
if (hSearch == INVALID_HANDLE_VALUE) break; // No more files found
WCHAR* pos = wcschr(fd.cFileName, L'.');
if (pos)
{
@ -1603,10 +1602,8 @@ void CDialogManage::CTabSettings::Initialize()
// Strip brackets in language name
std::wstring text = fd.cFileName;
text += L" - ";
GetLocaleInfo(lcid, LOCALE_SNATIVELANGUAGENAME, fd.cFileName, MAX_PATH);
// Some native language names don't start with a uppercase char..
LCMapString(LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, &fd.cFileName[0], 1, &fd.cFileName[0], 1);
GetLocaleInfo(lcid, LOCALE_SNATIVELANGUAGENAME, fd.cFileName, MAX_PATH);
text += fd.cFileName;
int index = ComboBox_AddString(item, text.c_str());
@ -1622,6 +1619,7 @@ void CDialogManage::CTabSettings::Initialize()
while (FindNextFile(hSearch, &fd));
FindClose(hSearch);
}
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX), !Rainmeter->GetDisableVersionCheck());
Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX), Rainmeter->GetDisableDragging());