Manage Themes: Fixed that m_Themes order differed from listbox in some cases

This commit is contained in:
Birunthan Mohanathas 2012-04-20 08:58:10 +03:00
parent d74ddda1b2
commit f1af3786d4

View File

@ -1474,23 +1474,9 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST);
ListBox_AddString(item, theme.c_str());
// Add theme to vector
std::vector<std::wstring>& themes = Rainmeter->m_Themes;
if (!themes.empty())
{
std::vector<std::wstring>::iterator iter = themes.begin();
for ( ; iter != themes.end(); ++iter)
{
if (wcscmp(theme.c_str(), (*iter).c_str()) < 0)
{
themes.insert(iter, theme);
return TRUE;
}
}
}
// If themes empty or if name is alphabetically after vector contents
themes.push_back(theme);
path = Rainmeter->GetSettingsPath();
path += L"Themes\\";
Rainmeter->ScanForThemes(path);
}
}
break;