diff options
author | Max Eliaser <[email protected]> | 2018-12-30 14:20:02 -0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-01-03 20:29:22 +0000 |
commit | 9991fb1762bd44762c4ee43b2484f30114a307d4 (patch) | |
tree | 245286d4ab0336ecd6753bb61746f1f91731b933 /libcaja-private/caja-mime-actions.c | |
parent | e51b16d36919d1f075804cffcb9739c2ce761028 (diff) | |
download | caja-9991fb1762bd44762c4ee43b2484f30114a307d4.tar.bz2 caja-9991fb1762bd44762c4ee43b2484f30114a307d4.tar.xz |
[libcaja-private] Re-check file MIME type before picking an application.
An example of when the MIME type might change: a file is initially created
with 0 bytes of content, but more data is added later. Empty files are always
detected as plain text, but the file might not be empty anymore when the user
opens it.
This commit affects the behavior when double-clicking a file and when right-
clicking on it too.
Diffstat (limited to 'libcaja-private/caja-mime-actions.c')
-rw-r--r-- | libcaja-private/caja-mime-actions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index 2171d7eb..3018b9f8 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -997,6 +997,12 @@ make_activation_parameters (GList *uris, uri = l->data; file = caja_file_get_by_uri (uri); + /* Double-check if a file's MIME type has changed before we commit to a + choice of application for it. This can happen if, for instance, file + was originally created with 0 bytes and then content was added to it + later-- it will change from plaintext to something else. */ + caja_file_refresh_info (file); + app = caja_mime_get_default_application_for_file (file); if (app != NULL) { |