Minor improvement to About dialog (The plugins list is now generated only when Plugins entry is selected, not on initialization. As a result, the About dialog opens considerably faster.).

This commit is contained in:
Birunthan Mohanathas 2011-01-30 16:21:00 +00:00
parent 7b5330896f
commit 054bcd9796
2 changed files with 68 additions and 66 deletions

View File

@ -288,6 +288,11 @@ void UpdateWidgets()
ListView_SetColumn(widget, 2, &lvc);
// Update the list of plugins
if (g_Plugins.empty())
{
ScanPlugins();
}
std::vector<PLUGIN_INFO>::const_iterator iter = g_Plugins.begin();
LVITEM vitem;
vitem.mask = LVIF_TEXT;
@ -343,8 +348,6 @@ void ScanPlugins()
std::wstring files = Rainmeter->GetPluginPath() + L"*.dll";
g_Plugins.clear();
// Start searching for .ini files in the given directory.
hSearch = FindFirstFile(files.c_str(), &fileData);
do
@ -486,8 +489,6 @@ BOOL OnInitAboutDialog(HWND window)
lvc.cx = 150;
lvc.pszText = L"Message";
ListView_InsertColumn(widget, 2, &lvc);
ScanPlugins();
}
UpdateWidgets();

View File

@ -26,6 +26,7 @@
HWND OpenAboutDialog(HWND hwndOwner, HINSTANCE instance);
void UpdateAboutDialog();
void UpdateAboutStatistics(LPCTSTR entryName = NULL);
void ScanPlugins();
#endif