diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 20:01:14 +0300 |
commit | 39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch) | |
tree | 7982eda1257f7466b5663c2865fdb7804c397257 /plugins/Quotes/src | |
parent | 5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff) |
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/Quotes/src')
-rw-r--r-- | plugins/Quotes/src/ImportExport.cpp | 2 | ||||
-rw-r--r-- | plugins/Quotes/src/QuotesProviders.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index 6836c11520..279700170e 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -222,7 +222,7 @@ INT_PTR Quotes_Export(WPARAM wp, LPARAM lp) }
}
else {
- for (hContact = db_find_first(QUOTES_MODULE_NAME); hContact; hContact = db_find_next(hContact, QUOTES_MODULE_NAME)) {
+ for (auto &hContact : contact_iter(QUOTES_MODULE_NAME)) {
CQuotesProviders::TQuotesProviderPtr pProvider = pProviders->GetContactProviderPtr(hContact);
if (pProvider) {
IXMLNode::TXMLNodePtr pNode = export_contact(hContact, pXmlEngine);
diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index b097901502..ebfff01994 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -51,7 +51,7 @@ void CQuotesProviders::InitProviders() const WORD nCurrentVersion = 17;
WORD nVersion = db_get_w(NULL, QUOTES_MODULE_NAME, LAST_RUN_VERSION, 1);
- for (MCONTACT hContact = db_find_first(QUOTES_MODULE_NAME); hContact; hContact = db_find_next(hContact, QUOTES_MODULE_NAME)) {
+ for (auto &hContact : contact_iter(QUOTES_MODULE_NAME)) {
TQuotesProviderPtr pProvider = GetContactProviderPtr(hContact);
if (pProvider) {
pProvider->AddContact(hContact);
|