Qt: Fix "QFSFileEngine::open: No file name specified" warning

This commit is contained in:
Vicki Pfau 2024-10-29 22:40:23 -07:00
parent 65b14b4ad9
commit 47e5cd2432
1 changed files with 12 additions and 2 deletions

View File

@ -1086,7 +1086,12 @@ void Window::reloadDisplayDriver() {
m_display->setMinimumSize(GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS); m_display->setMinimumSize(GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS);
#endif #endif
m_display->setBackgroundImage(QImage{m_config->getOption("backgroundImage")}); QString backgroundImage = m_config->getOption("backgroundImage");
if (backgroundImage.isEmpty()) {
m_display->setBackgroundImage(QImage{});
} else {
m_display->setBackgroundImage(QImage{backgroundImage});
}
if (!proxy) { if (!proxy) {
proxy = std::make_shared<VideoProxy>(); proxy = std::make_shared<VideoProxy>();
@ -1978,7 +1983,12 @@ void Window::setupOptions() {
ConfigOption* backgroundImage = m_config->addOption("backgroundImage"); ConfigOption* backgroundImage = m_config->addOption("backgroundImage");
backgroundImage->connect([this](const QVariant& value) { backgroundImage->connect([this](const QVariant& value) {
if (m_display) { if (m_display) {
m_display->setBackgroundImage(QImage{value.toString()}); QString backgroundImage = value.toString();
if (backgroundImage.isEmpty()) {
m_display->setBackgroundImage(QImage{});
} else {
m_display->setBackgroundImage(QImage{backgroundImage});
}
} }
}, this); }, this);
m_config->updateOption("backgroundImage"); m_config->updateOption("backgroundImage");