From b91bacb43af4f797981c7933f944da2ad6c0c06d Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Fri, 22 Nov 2024 16:13:58 +0300 Subject: [PATCH] Core: Do not generate `*.uid` files for JSON, certificates, and translations --- core/crypto/crypto.h | 4 ++++ core/io/json.h | 4 ++++ core/io/translation_loader_po.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/core/crypto/crypto.h b/core/crypto/crypto.h index c19e6b6773b..dc4441c9b88 100644 --- a/core/crypto/crypto.h +++ b/core/crypto/crypto.h @@ -155,6 +155,10 @@ public: virtual void get_recognized_extensions(List *p_extensions) const override; virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + + // Treat certificates as text files, do not generate a `*.{crt,key,pub}.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } }; class ResourceFormatSaverCrypto : public ResourceFormatSaver { diff --git a/core/io/json.h b/core/io/json.h index 67b5e09afa0..3443b5ca28b 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -105,6 +105,10 @@ public: virtual void get_recognized_extensions(List *p_extensions) const override; virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + + // Treat JSON as a text file, do not generate a `*.json.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } }; class ResourceFormatSaverJSON : public ResourceFormatSaver { diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h index a695826e599..1f9782c4253 100644 --- a/core/io/translation_loader_po.h +++ b/core/io/translation_loader_po.h @@ -43,6 +43,10 @@ public: virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; + // Treat translations as text/binary files, do not generate a `*.{po,mo}.uid` file. + virtual ResourceUID::ID get_resource_uid(const String &p_path) const override { return ResourceUID::INVALID_ID; } + virtual bool has_custom_uid_support() const override { return true; } + TranslationLoaderPO() {} };