Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Ask Windows for Affinity files' thumbnails (packaged provider)

gelenmedya34f962a323d8
diff --git a/crates/rf-app/src/icons.rs b/crates/rf-app/src/icons.rs
index e2785dad..6b09d2a8 100644
--- a/crates/rf-app/src/icons.rs
+++ b/crates/rf-app/src/icons.rs
@@ -215,9 +215,18 @@ pub fn has_sure_thumbnail(e: &Entry) -> bool {
/// one that has none looks as it did before. Not programs and shortcuts: those keep their own icons (a shortcut's "thumbnail"
/// would be its target's).
pub fn may_have_thumbnail(e: &Entry) -> bool {
- !e.is_dir() && !e.is_cloud_placeholder() && !has_sure_thumbnail(e) && category(e) != Category::Executable && rf_win::thumbs::has_provider(&e.ext)
+ !e.is_dir()
+ && !e.is_cloud_placeholder()
+ && !has_sure_thumbnail(e)
+ && category(e) != Category::Executable
+ && (rf_win::thumbs::has_provider(&e.ext) || PACKAGED_PROVIDERS.contains(&&*e.ext))
}
+/// Types whose thumbnail provider comes inside a packaged (MSIX) app: the registry the provider check reads does not name it, but
+/// the shell finds and uses it (discussion 731: Affinity's files were pictured in File Explorer and stayed icons here). A file of
+/// such a type without the app installed only costs one question to the shell.
+const PACKAGED_PROVIDERS: &[&str] = &["af", "afdesign", "afphoto", "afpub", "aftemplate"];
+
pub fn icon_for(cat: Category) -> L {
use Category::*;
match cat {