From 94086b1650ccdf2ba2a33307946e07a124dc1eae Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 22 Nov 2022 18:06:20 -0500 Subject: [PATCH] properties_view: Add comment explaining the purpose of build_dimensions() Sophie Herold mentioned that it's not entirely clear why we're loading the image data again here. This comment should explain why to future readers. --- src/widgets/properties_view.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/properties_view.rs b/src/widgets/properties_view.rs index 95b4e59..5dfb461 100644 --- a/src/widgets/properties_view.rs +++ b/src/widgets/properties_view.rs @@ -233,6 +233,11 @@ impl LpPropertiesView { self.notify("file-info"); } + // Determines the dimensions of the file asyncronously. We do this + // asycnhronously to avoid blocking the UI as we parse the file info. + // In addition, we're loading the image metadata separately from the file + // here so that the properties sidebar's information can load separately + // from the current file. fn build_dimensions(&self, info: &gio::FileInfo, file: &gio::File) { let imp = self.imp();