Index: src/plugin/PluginSettings.cpp |
=================================================================== |
--- a/src/plugin/PluginSettings.cpp |
+++ b/src/plugin/PluginSettings.cpp |
@@ -66,7 +66,7 @@ |
CComAutoCriticalSection CPluginSettings::s_criticalSectionLocal; |
-CPluginSettings::CPluginSettings() : m_dwWorkingThreadId(0), m_isPluginEnabledTab(true) |
+CPluginSettings::CPluginSettings() : m_dwWorkingThreadId(0) |
{ |
s_instance = NULL; |
@@ -149,7 +149,7 @@ |
bool CPluginSettings::IsPluginEnabled() const |
{ |
- return m_isPluginEnabledTab; |
+ return GetPluginEnabled(); |
} |
@@ -187,30 +187,11 @@ |
void CPluginSettings::TogglePluginEnabled() |
{ |
- CPluginSettingsTabLock lock; |
- if (lock.IsLocked()) |
- { |
- s_criticalSectionLocal.Lock(); |
- { |
- //TODO: Query if plugin is enabled from the AdblockPlusEngine |
- m_isPluginEnabledTab = m_isPluginEnabledTab ? false : true; |
- //TODO: Set plugin enabled/disabled in AdblockPlusEngine |
- } |
- s_criticalSectionLocal.Unlock(); |
- } |
+ GetPluginEnabled() ? SetPluginDisabled() : SetPluginEnabled(); |
Wladimir Palant
2013/08/13 14:25:29
The SetPluginEnabled/SetPluginDisabled functions a
|
} |
void CPluginSettings::SetPluginDisabled() |
{ |
- CPluginSettingsTabLock lock; |
- if (lock.IsLocked()) |
- { |
- s_criticalSectionLocal.Lock(); |
- { |
- m_isPluginEnabledTab = false; |
- //TODO: Set plugin disabled in AdblockPlusEngine |
- } |
- s_criticalSectionLocal.Unlock(); |
- } |
+ CPluginClient::GetInstance()->SetPref(L"enabled", false); |
} |
void CPluginSettings::SetPluginEnabled() |
{ |