Unload old plugin and load new one when replacing an existing plugin during install

This commit is contained in:
Adam Honse 2021-08-28 13:44:50 -05:00
parent 208deaea12
commit 2643ed0d8f

View file

@ -99,6 +99,8 @@ void Ui::OpenRGBPluginsPage::on_InstallPluginButton_clicked()
}
}
if(match == true)
{
QMessageBox::StandardButton reply;
@ -113,18 +115,14 @@ void Ui::OpenRGBPluginsPage::on_InstallPluginButton_clicked()
try
{
plugin_manager->RemovePlugin(to_file);
filesystem::copy(from_path, to_path, filesystem::copy_options::update_existing);
//TODO: Unregister the old plugin and load the new one if matched
// For now, don't load the new plugin
if(match == false)
{
plugin_manager->AddPlugin(to_path + "/" + filesystem::path(from_path).filename().string());
plugin_manager->AddPlugin(to_file);
RefreshList();
}
}
catch(std::exception& e)
{