diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch) | |
tree | 247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/Folders/src/dlg_handlers.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/Folders/src/dlg_handlers.cpp')
-rw-r--r-- | plugins/Folders/src/dlg_handlers.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index 806b0972c7..1135235741 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -35,12 +35,11 @@ static void LoadRegisteredFolderSections(HWND hWnd) {
HWND hwndList = GetDlgItem(hWnd, IDC_FOLDERS_SECTIONS_LIST);
- for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
- CFolderItem &tmp = lstRegisteredFolders[i];
- wchar_t *translated = mir_a2u(tmp.GetSection());
+ for (auto &it : lstRegisteredFolders) {
+ wchar_t *translated = mir_a2u(it->GetSection());
if (!ContainsSection(hWnd, TranslateW(translated))) {
int idx = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)TranslateW(translated));
- SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)tmp.GetSection());
+ SendMessage(hwndList, LB_SETITEMDATA, idx, (LPARAM)it->GetSection());
}
mir_free(translated);
@@ -58,11 +57,10 @@ static void LoadRegisteredFolderItems(HWND hWnd) HWND hwndItems = GetDlgItem(hWnd, IDC_FOLDERS_ITEMS_LIST);
SendMessage(hwndItems, LB_RESETCONTENT, 0, 0);
- for (int i = 0; i < lstRegisteredFolders.getCount(); i++) {
- CFolderItem &item = lstRegisteredFolders[i];
- if (!mir_strcmp(szSection, item.GetSection())) {
- idx = SendMessage(hwndItems, LB_ADDSTRING, 0, (LPARAM)TranslateW(item.GetUserName()));
- SendMessage(hwndItems, LB_SETITEMDATA, idx, (LPARAM)&item);
+ for (auto &it : lstRegisteredFolders) {
+ if (!mir_strcmp(szSection, it->GetSection())) {
+ idx = SendMessage(hwndItems, LB_ADDSTRING, 0, (LPARAM)TranslateW(it->GetUserName()));
+ SendMessage(hwndItems, LB_SETITEMDATA, idx, (LPARAM)it);
}
}
SendMessage(hwndItems, LB_SETCURSEL, 0, 0); //select the first item
@@ -234,8 +232,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l LoadItem(hWnd, item);
}
- for (int i = 0; i < lstRegisteredFolders.getCount(); i++)
- lstRegisteredFolders[i].Save();
+ for (auto &it : lstRegisteredFolders)
+ it->Save();
CallPathChangedEvents();
}
}
|