diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:33:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | ba75602b16e4b9b484c2c05f70c117f612c81e1d (patch) | |
tree | c19e7066ece1d545437bd8482af888660e54e0d8 /plugins/Popup/src/popup_thread.cpp | |
parent | 95ce21d8512af00a4c5f607091a459b789f79b79 (diff) |
Popup+: C++'11 iterators
Diffstat (limited to 'plugins/Popup/src/popup_thread.cpp')
-rw-r--r-- | plugins/Popup/src/popup_thread.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 1a5b462632..75e306a0b8 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -135,9 +135,9 @@ void RepositionPopups() {
PopupWnd2 *prev = nullptr;
if (PopupOptions.ReorderPopups) {
- for (int i = 0; i < popupList.getCount(); ++i) {
- UpdatePopupPosition(prev, popupList[i]);
- prev = popupList[i];
+ for (auto &it : popupList) {
+ UpdatePopupPosition(prev, it);
+ prev = it;
}
}
}
@@ -153,8 +153,8 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA case UTM_STOP_THREAD:
gTerminating = true;
if (db_get_b(NULL, MODULNAME, "FastExit", 0))
- for (int i = 0; i < popupList.getCount(); ++i)
- PUDeletePopup(popupList[i]->getHwnd());
+ for (auto &it : popupList)
+ PUDeletePopup(it->getHwnd());
PostQuitMessage(0);
break;
@@ -198,11 +198,9 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA break;
case UTM_AVATAR_CHANGED:
- for (int i = 0; i < popupList.getCount(); i++) {
- PopupWnd2 *p = popupList[i];
+ for (auto &p : popupList)
if (p->getContact() == wParam)
SendMessage(p->getHwnd(), UM_AVATARCHANGED, 0, 0);
- }
break;
}
return DefWindowProc(hwnd, message, wParam, lParam);
@@ -277,8 +275,8 @@ void UnloadPopupThread() WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
- for (int i = 0; i < popupList.getCount(); ++i)
- delete popupList[i];
+ for (auto &it : popupList)
+ delete it;
popupList.destroy();
}
|