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

Unified Diff: src/plugin/PluginClassThread.cpp

Issue 11013110: Cleanup (Closed)
Patch Set: Created July 5, 2013, 3:28 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginClassThread.cpp
===================================================================
--- a/src/plugin/PluginClassThread.cpp
+++ b/src/plugin/PluginClassThread.cpp
@@ -5,7 +5,6 @@
#include "PluginClass.h"
#include "PluginSettings.h"
#include "PluginSystem.h"
-#include "PluginConfiguration.h"
#ifdef SUPPORT_FILTER
#include "PluginFilter.h"
#endif
@@ -17,7 +16,6 @@
#include "PluginClient.h"
#include "PluginClientFactory.h"
#include "PluginWbPassThrough.h"
-#include "PluginHttpRequest.h"
#include "ProtocolImpl.h"
#include "ProtocolCF.h"
@@ -58,38 +56,15 @@
debugText += L"\nWindows version: " + ver;
-
- CString proxyName;
- CString proxyBypass;
-
- if (CPluginHttpRequest::GetProxySettings(proxyName, proxyBypass))
- {
- if (!proxyName.IsEmpty())
- {
- debugText += L"\nHTTP proxy name: " + proxyName;
- }
- if (!proxyBypass.IsEmpty())
- {
- debugText += L"\nHTTP proxy bypass: " + proxyBypass;
- }
- }
-
debugText += L"\n================================================================================";
DEBUG_GENERAL(debugText)
- HANDLE hMainThread = GetMainThreadHandle();
-
- CPluginClient* client = CPluginClient::GetInstance();
- client->SetLocalization();
+ HANDLE hMainThread = GetMainThreadHandle();
DWORD nNextUserTimerBase = GetTickCount() / TIMER_INTERVAL_USER_REGISTRATION + 1;
DWORD nUserTimerBaseStep = 1;
- bool isConfigutationLoaded = false;
-
- std::auto_ptr<CPluginConfiguration> configuration = std::auto_ptr<CPluginConfiguration>(new CPluginConfiguration);
-
// --------------------------------------------------------------------
// Welcome / Info page
// --------------------------------------------------------------------
@@ -101,20 +76,8 @@
WORD wInfo = 0;
WORD wInfoSettings = 0;
- wInfo = wInfoSettings = settings->GetValue(SETTING_PLUGIN_INFO_PANEL, 0);
- if (wInfo == 1)
- {
- DEBUG_GENERAL("*** Display welcome page")
- }
- else if (wInfo == 2)
- {
- DEBUG_GENERAL("*** Display update page")
- }
- else if (wInfo != 0)
- {
- DEBUG_GENERAL("*** Display info page")
- }
+ // TODO: Add First run page logic here
if (wInfo != 0)
{
DEBUG_THREAD("Thread::Set info page (action)");
@@ -124,12 +87,6 @@
::PostMessage(tab->m_plugin->m_hPaneWnd, WM_LAUNCH_INFO, wInfo, NULL);
}
s_criticalSectionLocal.Unlock();
-
- if (wInfoSettings == wInfo)
- {
- settings->Remove(SETTING_PLUGIN_INFO_PANEL);
- settings->Write();
- }
}
}
@@ -160,54 +117,19 @@
{
DEBUG_THREAD("Thread::Update settings");
- if (configuration->IsValid())
- {
- bool isNewDictionaryVersion = false;
+ bool isNewDictionaryVersion = false;
#ifdef SUPPORT_FILTER
- bool isNewFilterVersion = false;
+ bool isNewFilterVersion = false;
#endif
#ifdef SUPPORT_CONFIG
- bool isNewConfig = false;
+ bool isNewConfig = false;
#endif
- DEBUG_THREAD("Thread::Update settings (action)");
+ DEBUG_THREAD("Thread::Update settings (action)");
- settings->ForceConfigurationUpdateOnStart(false);
-
- if (configuration->IsValidPluginInfoPanel())
- {
- settings->SetValue(SETTING_PLUGIN_INFO_PANEL, configuration->GetPluginInfoPanel());
- }
-
-#ifdef SUPPORT_FILTER
- // Update filter URL list
- if (configuration->IsValidFilter())
- {
- isNewFilterVersion = true;
- }
-#endif // SUPPORT_FILTER
-
- settings->Write();
-
- configuration->Invalidate();
-
-#ifdef SUPPORT_FILTER
- DEBUG_GENERAL("*** before isNewFilterVersion");
-
- // Update filters, if needed (5 days * (random() * 0.4 + 0.8))
- if (isNewFilterVersion)
- {
-
- DEBUG_GENERAL("*** before CheckFilterAndDownload");
- settings->RefreshFilterlist();
-
-
- settings->Write();
-
- tab->OnUpdate();
- }
-#endif // SUPPORT_FILTER
- }
+ // Update filters, if needed (5 days * (random() * 0.4 + 0.8))
+ settings->RefreshFilterlist();
Wladimir Palant 2013/07/05 09:26:45 We shouldn't do that here - the engine will refres
+ tab->OnUpdate();
}

Powered by Google App Engine
This is Rietveld