Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginSettings.cpp

Issue 11427013: Appear fast for IE (Closed)
Patch Set: Created Aug. 7, 2013, 5:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include <Wbemidl.h> 3 #include <Wbemidl.h>
4 #include <time.h> 4 #include <time.h>
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 #include "PluginClient.h" 6 #include "PluginClient.h"
7 #include "PluginSystem.h" 7 #include "PluginSystem.h"
8 #ifdef SUPPORT_FILTER 8 #ifdef SUPPORT_FILTER
9 #include "PluginFilter.h" 9 #include "PluginFilter.h"
10 #endif 10 #endif
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 CPluginSettings* CPluginSettings::GetInstance() 87 CPluginSettings* CPluginSettings::GetInstance()
88 { 88 {
89 CPluginSettings* instance = NULL; 89 CPluginSettings* instance = NULL;
90 90
91 s_criticalSectionLocal.Lock(); 91 s_criticalSectionLocal.Lock();
92 { 92 {
93 if (!s_instance) 93 if (!s_instance)
94 { 94 {
95 s_instance = new CPluginSettings(); 95 s_instance = new CPluginSettings();
96 #ifdef USE_CONSOLE
97 CONSOLE("Fetching Available Subscription\n");
98 #endif
99 CPluginSettings::GetInstance()->m_subscriptions = CPluginClient::GetInstan ce()->FetchAvailableSubscriptions();
100 } 96 }
101 97
102 instance = s_instance; 98 instance = s_instance;
103 } 99 }
104 s_criticalSectionLocal.Unlock(); 100 s_criticalSectionLocal.Unlock();
105 101
106 return instance; 102 return instance;
107 } 103 }
108 104
109 105
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 148
153 149
154 bool CPluginSettings::IsPluginEnabled() const 150 bool CPluginSettings::IsPluginEnabled() const
155 { 151 {
156 return m_isPluginEnabledTab; 152 return m_isPluginEnabledTab;
157 } 153 }
158 154
159 155
160 std::map<CString, CString> CPluginSettings::GetFilterLanguageTitleList() const 156 std::map<CString, CString> CPluginSettings::GetFilterLanguageTitleList() const
161 { 157 {
158 CPluginSettings::GetInstance()->m_subscriptions = CPluginClient::GetInstance() ->FetchAvailableSubscriptions();
Felix Dahlke 2013/08/07 09:34:49 Why get the settings instance here? We're in a mem
159
162 std::map<CString, CString> filterList; 160 std::map<CString, CString> filterList;
163 for (size_t i = 0; i < m_subscriptions.size(); i ++) 161 for (size_t i = 0; i < m_subscriptions.size(); i ++)
164 { 162 {
165 SubscriptionDescription it = m_subscriptions[i]; 163 SubscriptionDescription it = m_subscriptions[i];
166 filterList.insert(std::make_pair(CString(it.url.c_str()), CString(it.title.c _str()))); 164 filterList.insert(std::make_pair(CString(it.url.c_str()), CString(it.title.c _str())));
167 } 165 }
168 return filterList; 166 return filterList;
169 } 167 }
170 168
171 bool CPluginSettings::IsWorkingThread(DWORD dwThreadId) const 169 bool CPluginSettings::IsWorkingThread(DWORD dwThreadId) const
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 358 }
361 359
362 CString CPluginSettings::GetDocumentationLink() 360 CString CPluginSettings::GetDocumentationLink()
363 { 361 {
364 return CString(CPluginClient::GetInstance()->GetDocumentationLink().c_str()); 362 return CString(CPluginClient::GetInstance()->GetDocumentationLink().c_str());
365 } 363 }
366 364
367 365
368 366
369 #endif // SUPPORT_WHITELIST 367 #endif // SUPPORT_WHITELIST
OLDNEW

Powered by Google App Engine
This is Rietveld