playbacksettings: Don't try to load empty icons

When populating output options, don't attempt to load an icon if that
field is empty. This cuts some log noise.
This commit is contained in:
Jim Broadus 2021-04-11 22:08:53 -07:00 committed by John Maguire
parent 32944a15de
commit 3440f90a6b
1 changed files with 7 additions and 5 deletions

View File

@ -63,12 +63,14 @@ void PlaybackSettingsPage::Load() {
ui_->gst_output->clear();
for (const GstEngine::OutputDetails& output : engine->GetOutputsList()) {
// Strip components off the icon name until we find one.
QStringList components = output.icon_name.split("-");
QIcon icon;
while (icon.isNull() && !components.isEmpty()) {
icon = IconLoader::Load(components.join("-"), IconLoader::Base);
components.removeLast();
if (!output.icon_name.isEmpty()) {
// Strip components off the icon name until we find one.
QStringList components = output.icon_name.split("-");
while (icon.isNull() && !components.isEmpty()) {
icon = IconLoader::Load(components.join("-"), IconLoader::Base);
components.removeLast();
}
}
ui_->gst_output->addItem(icon, output.description,