@@ -127,6 +127,38 @@ void PluginManager::AddPlugin(const filesystem::path& path, bool is_system)
127
127
128
128
unsigned int plugin_idx;
129
129
130
+ /* ---------------------------------------------------------------------*\
131
+ | Open plugin settings |
132
+ \*---------------------------------------------------------------------*/
133
+ json plugin_settings = ResourceManager::get ()->GetSettingsManager ()->GetSettings (" Plugins" );
134
+
135
+ /* ---------------------------------------------------------------------*\
136
+ | Check if this plugin is on the remove list |
137
+ \*---------------------------------------------------------------------*/
138
+ if (plugin_settings.contains (" plugins_remove" ))
139
+ {
140
+ for (unsigned int plugin_remove_idx = 0 ; plugin_remove_idx < plugin_settings[" plugins_remove" ].size (); plugin_remove_idx++)
141
+ {
142
+ LOG_WARNING (" [PluginManager] Checking remove %d, %s" , plugin_remove_idx, to_string (plugin_settings[" plugins_remove" ][plugin_remove_idx]).c_str ());
143
+
144
+ if (plugin_settings[" plugins_remove" ][plugin_remove_idx] == path.generic_u8string ())
145
+ {
146
+ /* ---------------------------------------------------------*\
147
+ | Delete the plugin file |
148
+ \*---------------------------------------------------------*/
149
+ filesystem::remove (path);
150
+ }
151
+
152
+ /* -----------------------------------------------------------------*\
153
+ | Erase the plugin from the remove list |
154
+ \*-----------------------------------------------------------------*/
155
+ plugin_settings[" plugins_remove" ].erase (plugin_remove_idx);
156
+
157
+ ResourceManager::get ()->GetSettingsManager ()->SetSettings (" Plugins" , plugin_settings);
158
+ ResourceManager::get ()->GetSettingsManager ()->SaveSettings ();
159
+ }
160
+ }
161
+
130
162
/* ---------------------------------------------------------------------*\
131
163
| Search active plugins to see if this path already exists |
132
164
\*---------------------------------------------------------------------*/
@@ -182,11 +214,6 @@ void PluginManager::AddPlugin(const filesystem::path& path, bool is_system)
182
214
bool found = false ;
183
215
unsigned int plugin_ct = 0 ;
184
216
185
- /* -----------------------------------------------------*\
186
- | Open plugin list and check if plugin is in the list |
187
- \*-----------------------------------------------------*/
188
- json plugin_settings = ResourceManager::get ()->GetSettingsManager ()->GetSettings (" Plugins" );
189
-
190
217
if (plugin_settings.contains (" plugins" ))
191
218
{
192
219
plugin_ct = (unsigned int )plugin_settings[" plugins" ].size ();
0 commit comments