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:
@@ -576,6 +576,24 @@ string RclConfig::getMimeHandlerDef(const string &mtype, bool filtertypes)
|
||||
return hs;
|
||||
}
|
||||
|
||||
bool RclConfig::getGuiFilterNames(list<string>& cats)
|
||||
{
|
||||
if (!mimeconf)
|
||||
return false;
|
||||
cats = mimeconf->getNamesShallow("guifilters");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RclConfig::getGuiFilter(const string& catfiltername, string& frag)
|
||||
{
|
||||
frag.clear();
|
||||
if (!mimeconf)
|
||||
return false;
|
||||
if (!mimeconf->get(catfiltername, frag, "guifilters"))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RclConfig::valueSplitAttributes(const string& whole, string& value,
|
||||
ConfSimple& attrs)
|
||||
{
|
||||
|
||||
@@ -202,6 +202,11 @@ class RclConfig {
|
||||
/** mimeconf: get list of mime types for category */
|
||||
bool getMimeCatTypes(const string& cat, list<string>&);
|
||||
|
||||
/** mimeconf: get list of gui filters (doc cats by default */
|
||||
bool getGuiFilterNames(list<string>&);
|
||||
/** mimeconf: get query lang frag for named filter */
|
||||
bool getGuiFilter(const string& filtername, string& frag);
|
||||
|
||||
/** fields: get field prefix from field name */
|
||||
bool getFieldTraits(const string& fldname, const FieldTraits **);
|
||||
const set<string>& getStoredFields() {return m_storedFields;}
|
||||
|
||||
Reference in New Issue
Block a user