summaryrefslogtreecommitdiff
path: root/Base/etc
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-11-14 15:26:23 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-15 16:49:40 +0100
commit6b9ff8d6e201cb125d177a3fb0ddb0d2648a7736 (patch)
tree2c08e9957052e806cbb8ef7aeffa34dfba79de47 /Base/etc
parent42bc518d709c0ca59d3347fb9dd112a3a0234e73 (diff)
downloadserenity-6b9ff8d6e201cb125d177a3fb0ddb0d2648a7736.zip
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".
Diffstat (limited to 'Base/etc')
-rw-r--r--Base/etc/FileIconProvider.ini18
1 files changed, 18 insertions, 0 deletions
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