diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index fc47f9bbe..5df9d3f8d 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -428,13 +428,7 @@ void LauncherDialog::loadRomInfo() const string& md5 = selectedRomMD5(); if(md5 != EmptyString) - { - // Get the properties for this entry - Properties props; - instance().propSet().getMD5WithInsert(currentNode(), md5, props); - - myRomInfoWidget->setProperties(props, currentNode()); - } + myRomInfoWidget->setProperties(currentNode(), md5); else myRomInfoWidget->clearProperties(); } diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 752876735..0df0610d3 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -27,6 +27,7 @@ #include "Logger.hxx" #include "Props.hxx" #include "PNGLibrary.hxx" +#include "PropsSet.hxx" #include "Rect.hxx" #include "Widget.hxx" #include "RomInfoWidget.hxx" @@ -44,20 +45,10 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RomInfoWidget::reloadProperties(const FilesystemNode& node) -{ - // The ROM may have changed since we were last in the browser, either - // by saving a different image or through a change in video renderer, - // so we reload the properties - if(myHaveProperties) - parseProperties(node); -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RomInfoWidget::setProperties(const Properties& props, const FilesystemNode& node) +void RomInfoWidget::setProperties(const FilesystemNode& node, const string& md5) { myHaveProperties = true; - myProperties = props; + instance().propSet().getMD5(md5, myProperties); // Decide whether the information should be shown immediately if(instance().eventHandler().state() == EventHandlerState::LAUNCHER) @@ -76,6 +67,16 @@ void RomInfoWidget::clearProperties() setDirty(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void RomInfoWidget::reloadProperties(const FilesystemNode& node) +{ + // The ROM may have changed since we were last in the browser, either + // by saving a different image or through a change in video renderer, + // so we reload the properties + if(myHaveProperties) + parseProperties(node); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomInfoWidget::parseProperties(const FilesystemNode& node) { @@ -140,8 +141,7 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node) try { ByteBuffer image; - string md5 = myProperties.get(PropType::Cart_MD5); - size_t size = 0; + string md5 = ""; size_t size = 0; if(node.exists() && !node.isDirectory() && (image = instance().openROM(node, md5, size)) != nullptr) diff --git a/src/gui/RomInfoWidget.hxx b/src/gui/RomInfoWidget.hxx index e1a964263..e2ea566ca 100644 --- a/src/gui/RomInfoWidget.hxx +++ b/src/gui/RomInfoWidget.hxx @@ -35,7 +35,7 @@ class RomInfoWidget : public Widget const Common::Size& imgSize); virtual ~RomInfoWidget() = default; - void setProperties(const Properties& props, const FilesystemNode& node); + void setProperties(const FilesystemNode& node, const string& md5); void clearProperties(); void reloadProperties(const FilesystemNode& node);