From 6b9ff8d6e201cb125d177a3fb0ddb0d2648a7736 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 14 Nov 2020 15:26:23 +0000 Subject: LibGUI/FileIconProvider: Add config file and use patterns This moves file extension to icon mappings from compile time macros to an INI config file (/etc/FileIconProvider.ini), so file icons can easily be customized and extended :^) I also switched the format from a static file extension (".foo") to glob-like patterns ("*.foo", using StringUtils::matches()), which allows us to assign icons to specific exactly matching file names, like many IDEs do - e.g. "CMakeLists.txt" or ".prettierrc". --- Base/etc/FileIconProvider.ini | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Base/etc/FileIconProvider.ini (limited to 'Base/etc') diff --git a/Base/etc/FileIconProvider.ini b/Base/etc/FileIconProvider.ini new file mode 100644 index 0000000000..373dcf643e --- /dev/null +++ b/Base/etc/FileIconProvider.ini @@ -0,0 +1,18 @@ +[Icons] +cplusplus=*.cpp,*.cxx,*.cc,*.c++ +form=*.frm +hackstudio=*.hsp +header=*.h,*.hpp,*.hxx,*.hh,*.h++ +html=*.html,*.htm +ini=*.ini +java=*.java +javascript=*.js,*.mjs +library=*.so,*.a +markdown=*.md +music=*.midi +object=*.o,*.obj +pdf=*.pdf +python=*.py +sound=*.wav +spreadsheet=*.sheets +text=*.txt -- cgit v1.2.3