@@ -44,25 +44,25 @@ void Ui::OpenRGBPluginsPage::RefreshList()
4444 ui->PluginsList ->clear ();
4545 entries.clear ();
4646
47- for (unsigned int plugin_idx = 0 ; plugin_idx < plugin_manager->ActivePlugins . size (); plugin_idx++ )
47+ for (const OpenRGBPluginEntry& plugin: plugin_manager->ActivePlugins )
4848 {
4949 OpenRGBPluginsEntry* entry = new OpenRGBPluginsEntry ();
5050
5151 /* ---------------------------------------------------------*\
5252 | Fill in plugin information fields |
5353 \*---------------------------------------------------------*/
54- entry->ui ->NameValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .info .Name ));
55- entry->ui ->DescriptionValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .info .Description ));
56- entry->ui ->VersionValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .info .Version ));
57- entry->ui ->CommitValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .info .Commit ));
58- entry->ui ->URLValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .info .URL ));
59- entry->ui ->APIVersionValue ->setText (QString::number (plugin_manager-> ActivePlugins [plugin_idx] .api_version ));
54+ entry->ui ->NameValue ->setText (QString::fromStdString (plugin .info .Name ));
55+ entry->ui ->DescriptionValue ->setText (QString::fromStdString (plugin .info .Description ));
56+ entry->ui ->VersionValue ->setText (QString::fromStdString (plugin .info .Version ));
57+ entry->ui ->CommitValue ->setText (QString::fromStdString (plugin .info .Commit ));
58+ entry->ui ->URLValue ->setText (QString::fromStdString (plugin .info .URL ));
59+ entry->ui ->APIVersionValue ->setText (QString::number (plugin .api_version ));
6060
6161 /* ---------------------------------------------------------*\
6262 | If the plugin is incompatible, highlight the API version |
6363 | in red and disable the enable checkbox |
6464 \*---------------------------------------------------------*/
65- if (plugin_manager-> ActivePlugins [plugin_idx] .incompatible )
65+ if (plugin .incompatible )
6666 {
6767 entry->ui ->APIVersionValue ->setStyleSheet (" QLabel { color : red; }" );
6868 entry->ui ->EnabledCheckBox ->setEnabled (false );
@@ -71,20 +71,20 @@ void Ui::OpenRGBPluginsPage::RefreshList()
7171 /* ---------------------------------------------------------*\
7272 | Fill in plugin icon |
7373 \*---------------------------------------------------------*/
74- QPixmap pixmap (QPixmap::fromImage (plugin_manager-> ActivePlugins [plugin_idx] .info .Icon ));
74+ QPixmap pixmap (QPixmap::fromImage (plugin .info .Icon ));
7575
7676 entry->ui ->IconView ->setPixmap (pixmap);
7777 entry->ui ->IconView ->setScaledContents (true );
7878
7979 /* ---------------------------------------------------------*\
8080 | Fill in plugin path |
8181 \*---------------------------------------------------------*/
82- entry->ui ->PathValue ->setText (QString::fromStdString (plugin_manager-> ActivePlugins [plugin_idx] .path ));
82+ entry->ui ->PathValue ->setText (QString::fromStdString (plugin .path ));
8383
8484 /* ---------------------------------------------------------*\
8585 | Fill in plugin enabled status |
8686 \*---------------------------------------------------------*/
87- entry->ui ->EnabledCheckBox ->setChecked ((plugin_manager-> ActivePlugins [plugin_idx] .enabled ));
87+ entry->ui ->EnabledCheckBox ->setChecked ((plugin .enabled ));
8888
8989 entry->RegisterEnableClickCallback (EnableClickCallbackFunction, this );
9090
@@ -261,7 +261,7 @@ void Ui::OpenRGBPluginsPage::on_EnableButton_clicked(OpenRGBPluginsEntry* entry)
261261 \*-----------------------------------------------------*/
262262 std::string name = " " ;
263263 std::string description = " " ;
264- bool enabled = true ;
264+ bool enabled = entry-> ui -> EnabledCheckBox -> isChecked () ;
265265 bool found = false ;
266266 unsigned int plugin_ct = 0 ;
267267 unsigned int plugin_idx = 0 ;
@@ -270,15 +270,6 @@ void Ui::OpenRGBPluginsPage::on_EnableButton_clicked(OpenRGBPluginsEntry* entry)
270270 std::string entry_desc = entry->ui ->DescriptionValue ->text ().toStdString ();
271271 std::string entry_path = entry->ui ->PathValue ->text ().toStdString ();
272272
273- if (entry->ui ->EnabledCheckBox ->isChecked ())
274- {
275- enabled = true ;
276- }
277- else
278- {
279- enabled = false ;
280- }
281-
282273 if (plugin_settings.contains (" plugins" ))
283274 {
284275 plugin_ct = plugin_settings[" plugins" ].size ();
0 commit comments