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

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

Issue 11013110: Cleanup (Closed)
Patch Set: Created July 5, 2013, 3:28 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 "Plugin.h" 3 #include "Plugin.h"
4 #ifdef _WIN64 4 #ifdef _WIN64
5 #include "../../build/x64/AdblockPlus_i.c" 5 #include "../../build/x64/AdblockPlus_i.c"
6 #else 6 #else
7 #include "../../build/ia32/AdblockPlus_i.c" 7 #include "../../build/ia32/AdblockPlus_i.c"
8 #endif 8 #endif
9 9
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return _Module.UnregisterServer(TRUE); 106 return _Module.UnregisterServer(TRUE);
107 } 107 }
108 108
109 void InitPlugin(bool isInstall) 109 void InitPlugin(bool isInstall)
110 { 110 {
111 CPluginSystem* system = CPluginSystem::GetInstance(); 111 CPluginSystem* system = CPluginSystem::GetInstance();
112 112
113 CPluginSettings* settings = CPluginSettings::GetInstance(); 113 CPluginSettings* settings = CPluginSettings::GetInstance();
114 114
115 settings->SetMainProcessId(); 115 settings->SetMainProcessId();
116 settings->EraseTab();
117
118 settings->Remove(SETTING_PLUGIN_SELFTEST);
119 settings->SetValue(SETTING_PLUGIN_INFO_PANEL, isInstall ? 1 : 2);
120
121
122 settings->Write();
123 116
124 if (isInstall) 117 if (isInstall)
125 { 118 {
126 DEBUG_GENERAL( 119 DEBUG_GENERAL(
127 L"======================================================================== ========\nINSTALLER " + 120 L"======================================================================== ========\nINSTALLER " +
128 CString(IEPLUGIN_VERSION) + 121 CString(IEPLUGIN_VERSION) +
129 L"\n====================================================================== ==========") 122 L"\n====================================================================== ==========")
130 } 123 }
131 else 124 else
132 { 125 {
133 DEBUG_GENERAL( 126 DEBUG_GENERAL(
134 L"======================================================================== ========\nUPDATER " + 127 L"======================================================================== ========\nUPDATER " +
135 CString(IEPLUGIN_VERSION) + L" (UPDATED FROM " + settings->GetString(SETTI NG_PLUGIN_VERSION) + L")" 128 CString(IEPLUGIN_VERSION) +
136 L"\n====================================================================== ==========") 129 L"\n====================================================================== ==========")
137 } 130 }
138 131
139 // Create default filters 132 // Create default filters
140 #ifdef SUPPORT_FILTER 133 #ifdef SUPPORT_FILTER
141 // DEBUG_GENERAL(L"*** Generating default filters") 134 // DEBUG_GENERAL(L"*** Generating default filters")
142 // CPluginFilter::CreateFilters(); 135 // CPluginFilter::CreateFilters();
143 #endif 136 #endif
144 137
145 // Force creation of default config file
146 #ifdef SUPPORT_CONFIG
147 DEBUG_GENERAL("*** Generating config file")
148 CPluginConfig* config = CPluginConfig::GetInstance();
149 config->Create(true);
150 #endif
151
152 HKEY hKey = NULL; 138 HKEY hKey = NULL;
153 DWORD dwDisposition = 0; 139 DWORD dwDisposition = 0;
154 140
155 DWORD dwResult = NULL; 141 DWORD dwResult = NULL;
156 142
157 // Post async plugin error 143 // Post async plugin error
158 CPluginError pluginError; 144 CPluginError pluginError;
159 while (CPluginClientBase::PopFirstPluginError(pluginError)) 145 while (CPluginClientBase::PopFirstPluginError(pluginError))
160 { 146 {
161 CPluginClientBase::LogPluginError(pluginError.GetErrorCode(), pluginError.Ge tErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true , pluginError.GetProcessId(), pluginError.GetThreadId()); 147 CPluginClientBase::LogPluginError(pluginError.GetErrorCode(), pluginError.Ge tErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true , pluginError.GetProcessId(), pluginError.GetThreadId());
162 } 148 }
163 } 149 }
164 150
165 // Called from installer 151 // Called from installer
166 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp) 152 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp)
167 { 153 {
168 InitPlugin(true); 154 InitPlugin(true);
169 } 155 }
170 156
171 // Called from updater 157 // Called from updater
172 EXTERN_C void STDAPICALLTYPE OnUpdate(void) 158 EXTERN_C void STDAPICALLTYPE OnUpdate(void)
173 { 159 {
174 InitPlugin(false); 160 InitPlugin(false);
175 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld