From 563378c993b1c08a1bbe23e8f6c372c675c38e7a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Aug 2015 11:48:46 +0000 Subject: - naming conflict; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14986 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Quotes/src/CurrencyConverter.cpp | 2 +- plugins/Quotes/src/HTTPSession.cpp | 9 ++----- plugins/Quotes/src/ImportExport.cpp | 8 +++---- plugins/Quotes/src/OptionDukasCopy.cpp | 2 +- plugins/Quotes/src/QuotesProviderBase.cpp | 12 +++------- plugins/Quotes/src/QuotesProviderFinance.cpp | 2 +- plugins/Quotes/src/QuotesProviderGoogle.cpp | 35 ++++------------------------ 7 files changed, 17 insertions(+), 53 deletions(-) (limited to 'plugins/Quotes/src') diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index 9a3d45cb50..6858aa9a28 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -10,7 +10,7 @@ namespace { CQuotesProviderGoogle* get_google_provider() { - CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr(); + CModuleInfo::TQuotesProvidersPtr pProviders = CModuleInfo::GetQuoteProvidersPtr(); const CQuotesProviders::TQuotesProviders& rapQuotesProviders = pProviders->GetProviders(); for (CQuotesProviders::TQuotesProviders::const_iterator i = rapQuotesProviders.begin(); i != rapQuotesProviders.end(); ++i) { diff --git a/plugins/Quotes/src/HTTPSession.cpp b/plugins/Quotes/src/HTTPSession.cpp index 7c4e3f92b9..7390b2817f 100644 --- a/plugins/Quotes/src/HTTPSession.cpp +++ b/plugins/Quotes/src/HTTPSession.cpp @@ -128,23 +128,18 @@ namespace virtual bool OpenURL(const tstring& rsURL) { - // USES_CONVERSION; - m_aURL.swap(TBuffer()); std::string s = quotes_t2a(rsURL.c_str()); - const char* psz = s.c_str();//T2CA(rsURL.c_str()); + const char* psz = s.c_str(); m_aURL.insert(m_aURL.begin(), psz, psz + mir_strlen(psz) + 1); return true; - } + virtual bool ReadResponce(tstring& rsResponce)const { if (true == m_aURL.empty()) - { return false; - } - NETLIBHTTPREQUEST nlhr = { 0 }; nlhr.cbSize = sizeof(nlhr); diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index b3dc6e2a9d..aea84a8573 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -336,9 +336,9 @@ namespace tstring sName; tstring sValue; tstring sType; - for (size_t i = 0; i < cSetChild; ++i) + for (size_t j = 0; j < cSetChild; ++j) { - IXMLNode::TXMLNodePtr pNode = pSetting->GetChildNode(i); + IXMLNode::TXMLNodePtr pNode = pSetting->GetChildNode(j); tstring sNode = pNode->GetName(); if (0 == quotes_stricmp(g_pszXmlName, sNode.c_str())) { @@ -353,8 +353,8 @@ namespace if ((false == sName.empty()) && (false == sType.empty())) { - std::string s = quotes_t2a(sName.c_str()); - dbs.szSetting = s.c_str();//T2CA(sName.c_str()); + std::string s1 = quotes_t2a(sName.c_str()); + dbs.szSetting = s1.c_str(); if (0 == quotes_stricmp(g_pszXmlTypeByte, sType.c_str())) { tistringstream in(sValue.c_str()); diff --git a/plugins/Quotes/src/OptionDukasCopy.cpp b/plugins/Quotes/src/OptionDukasCopy.cpp index 074b545f14..6ded86da76 100644 --- a/plugins/Quotes/src/OptionDukasCopy.cpp +++ b/plugins/Quotes/src/OptionDukasCopy.cpp @@ -258,7 +258,7 @@ namespace CQuotesProviderDukasCopy* get_dukas_copy_provider() { - CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr(); + CModuleInfo::TQuotesProvidersPtr pProviders = CModuleInfo::GetQuoteProvidersPtr(); const CQuotesProviders::TQuotesProviders& rapQuotesProviders = pProviders->GetProviders(); for (CQuotesProviders::TQuotesProviders::const_iterator i = rapQuotesProviders.begin(); i != rapQuotesProviders.end(); ++i) { diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index a0d1ff989b..f66d976722 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -69,27 +69,21 @@ namespace tstring sName = pNode->GetName(); if (0 == quotes_stricmp(_T("section"), sName.c_str())) { - CQuotesProviderBase::CQuoteSection qs; - if (true == parse_section(pNode, qs)) - { - aSections.push_back(qs); - } + CQuotesProviderBase::CQuoteSection qs1; + if (true == parse_section(pNode, qs1)) + aSections.push_back(qs1); } else if (0 == quotes_stricmp(_T("quote"), sName.c_str())) { CQuotesProviderBase::CQuote q; if (true == parse_quote(pNode, q)) - { aQuotes.push_back(q); - } } else if (0 == quotes_stricmp(_T("name"), sName.c_str())) { sSectionName = pNode->GetText(); if (true == sSectionName.empty()) - { return false; - } } } diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index 4dac495ff1..a54d597ac1 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -303,7 +303,7 @@ void CQuotesProviderFinance::ShowPropertyPage(WPARAM wp, OPTIONSDIALOGPAGE &odp) { odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_OPT_FINANCE); odp.pfnDlgProc = GoogleFinanceOptDlgProc; - odp.dwInitParam = reinterpret_cast(static_cast(this)); + odp.dwInitParam = LPARAM(this); odp.ptszTab = const_cast(GetInfo().m_sName.c_str()); Options_AddPage(wp, &odp); } diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index 09d765cc34..c375d1506f 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -182,8 +182,6 @@ void CQuotesProviderGoogle::RefreshQuotes(TContracts& anContacts) tstring sHTML; if ((true == http.ReadResponce(sHTML)) && (true == IsOnline())) { - // LogIt(Info,sHTML); - double dRate = 0.0; if ((true == parse_responce(sHTML, dRate)) && (true == IsOnline())) { @@ -207,16 +205,14 @@ namespace CQuotesProviderGoogle* get_google_provider() { - CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr(); + CModuleInfo::TQuotesProvidersPtr pProviders = CModuleInfo::GetQuoteProvidersPtr(); const CQuotesProviders::TQuotesProviders& rapQuotesProviders = pProviders->GetProviders(); for (CQuotesProviders::TQuotesProviders::const_iterator i = rapQuotesProviders.begin(); i != rapQuotesProviders.end(); ++i) { const CQuotesProviders::TQuotesProviderPtr& pProvider = *i; CQuotesProviderGoogle* pGoogle = dynamic_cast(pProvider.get()); if (pGoogle) - { return pGoogle; - } } assert(!"We should never get here!"); @@ -230,9 +226,7 @@ namespace { const CQuotesProviderGoogle::CQuoteSection& rQuotes = pProvider->GetQuotes(); if (rQuotes.GetSectionCount() > 0) - { return rQuotes.GetSection(0); - } } return CQuotesProviderGoogle::CQuoteSection(); @@ -242,13 +236,9 @@ namespace const CQuotesProviderGoogle::CQuote& rTo) { if ((false == rFrom.GetName().empty()) && (false == rTo.GetName().empty())) - { return make_contact_name(rFrom.GetName(), rTo.GetName()); - } - else - { - return make_contact_name(rFrom.GetSymbol(), rTo.GetSymbol()); - } + + return make_contact_name(rFrom.GetSymbol(), rTo.GetSymbol()); } typedef std::vector TWatchedRates; @@ -267,8 +257,7 @@ namespace CCommonDlgProcData d(pProvider); CommonOptionDlgProc(hdlg, message, wParam, lParam, d); - switch (message) - { + switch (message) { case WM_NOTIFY: { LPNMHDR pNMHDR = reinterpret_cast(lParam); @@ -330,7 +319,7 @@ namespace ::SendMessage(hcbxTo, CB_ADDSTRING, 0, reinterpret_cast(pszName)); } - CQuotesProviderGoogle* pProvider = get_google_provider(); + pProvider = get_google_provider(); if (pProvider) { size_t cWatchedRates = pProvider->GetWatchedRateCount(); @@ -426,19 +415,8 @@ namespace break; } break; - // case LBN_SELCHANGE: - // switch(LOWORD(lParam)) - // { - // case IDC_LIST_RATES: - // { - // int nSel = ::SendDlgItemMessage(hdlg, IDC_LIST_RATES, LB_GETCURSEL, 0, 0); - // ::EnableWindow(::GetDlgItem(hdlg,IDC_BUTTON_REMOVE),(-1 != nSel)); - // } - // } - // break; } break; - } return FALSE; @@ -462,7 +440,6 @@ void CQuotesProviderGoogle::Accept(CQuotesProviderVisitor& visitor)const double CQuotesProviderGoogle::Convert(double dAmount, const CQuote& from, const CQuote& to)const { tstring sFullURL = build_url(GetURL(), from.GetID(), to.GetID(), dAmount); - // LogIt(Info,sFullURL); CHTTPSession http; if ((true == http.OpenURL(sFullURL))) @@ -470,8 +447,6 @@ double CQuotesProviderGoogle::Convert(double dAmount, const CQuote& from, const tstring sHTML; if ((true == http.ReadResponce(sHTML))) { - // LogIt(Info,sHTML); - double dResult = 0.0; if ((true == parse_responce(sHTML, dResult))) { -- cgit v1.2.3