mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 11:35:38 -04:00
[win32] RP_ExtractImage: Fix an issue with directory thumbnailing for unsupported directories.
RP_ExtractImage::Load() needs to return E_FAIL, not S_OK, if the directory is unsupported. Otherwise, Windows will show a regular directory icon, without thumbnailing the directory's contents. Fixes #427: No Thumbnails after install Reported by @Conan179.
This commit is contained in:
parent
e264415bcc
commit
bf7429ed29
8
NEWS.md
8
NEWS.md
@ -1,5 +1,13 @@
|
||||
# Changes
|
||||
|
||||
## v2.4.1 (released 2024/11/12)
|
||||
|
||||
* Bug fixes:
|
||||
* Windows: Fix an issue with directory thumbnailing that broke Windows'
|
||||
built-in directory thumbnailer if the directory isn't supported.
|
||||
* Fixes #427: No Thumbnails after install
|
||||
* Reported by @Conan179.
|
||||
|
||||
## v2.4 (released 2024/11/10)
|
||||
|
||||
* New features:
|
||||
|
@ -121,16 +121,22 @@ IFACEMETHODIMP RP_ExtractImage::Load(_In_ LPCOLESTR pszFileName, DWORD dwMode)
|
||||
}
|
||||
|
||||
// If ThumbnailDirectoryPackages is disabled, make sure this is *not* a directory.
|
||||
const bool is_directory = FileSystem::is_directory(d->olefilename);
|
||||
if (!config->getBoolConfigOption(Config::BoolConfig::Options_ThumbnailDirectoryPackages)) {
|
||||
if (FileSystem::is_directory(d->olefilename)) {
|
||||
if (is_directory) {
|
||||
// It's a directory. Don't thumbnail it.
|
||||
return S_OK;
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the appropriate RomData class for this ROM.
|
||||
// RomData class *must* support at least one image type.
|
||||
d->romData = RomDataFactory::create(d->olefilename, RomDataFactory::RDA_HAS_THUMBNAIL);
|
||||
if (!d->romData && is_directory) {
|
||||
// Unable to thumbnail this RomData class, and it's a directory.
|
||||
// Return E_FAIL in order to allow Explorer to thumbnail the directory normally.
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user