Implement the gui category filters as query language fragments instead of hard-coding them. This allows implementing other kinds of filtering (ie:on directory) just by changing a configuration file

This commit is contained in:
Jean-Francois Dockes
2012-02-18 11:21:09 +01:00
parent fab69fc3a1
commit ef00bfae70
11 changed files with 151 additions and 26 deletions
+29 -1
View File
@@ -194,7 +194,12 @@ text/x-purple-html-log = pidgin
text/x-python = text-x-python
[categories]
# Categories group mime types by "kind". They can be used from the query
# language as an "rclcat" clause. This is fully dynamic, you can change the
# names and groups as you wish, only the mime types are stored in the index.
#
# If you add/remove categories, you may also want to change the
# "guifilters" section below.
text = \
application/msword \
application/pdf \
@@ -280,3 +285,26 @@ other = application/vnd.sun.xml.draw \
application/x-rar \
application/x-webarchive \
application/zip \
[guifilters]
# This defines the top level filters in the GUI (accessed by the the
# radiobuttons above the results area, or a toolbar combobox).
# Each entry defines a label and a query language fragment that will be
# applied to filter the current query if the option is activated.
#
# This does not really belong in mimeconf, but it does belong in the index
# config (not the GUI one), because it's not necessarily the same in all
# configs, it has to go somewhere, and it's not worth a separate config
# file...
#
# By default this filters by document category (see above), but any
# language fragment should be ok. Be aware though that the "document
# history" queries only know about simple "rclcat" filtering.
text = rclcat:text
spreadsheet = rclcat:spreadsheet
presentation = rclcat:presentation
media = rclcat:media
message = rclcat:message
other = rclcat:other