mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix "QFSFileEngine::open: No file name specified" warning
This commit is contained in:
parent
65b14b4ad9
commit
47e5cd2432
|
@ -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");
|
||||||
|
|
Loading…
Reference in New Issue