added optional extended file attributes support
This commit is contained in:
@@ -34,3 +34,6 @@
|
||||
#undef HAVE_SYS_STATFS_H
|
||||
#undef HAVE_SYS_STATVFS_H
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
/* Use file extended attributes */
|
||||
#undef RCL_USE_XATTR
|
||||
|
||||
@@ -530,6 +530,15 @@ bool RclConfig::readFieldsConfig(const string& cnferrloc)
|
||||
}
|
||||
}
|
||||
|
||||
// Extended file attribute to field translations
|
||||
list<string>xattrs = m_fields->getNames("xattrtofields");
|
||||
for (list<string>::const_iterator it = xattrs.begin();
|
||||
it != xattrs.end(); it++) {
|
||||
string val;
|
||||
m_fields->get(*it, val, "xattrtofields");
|
||||
m_xattrtofld[*it] = val;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -881,7 +890,8 @@ void RclConfig::initFrom(const RclConfig& r)
|
||||
m_reason = r.m_reason;
|
||||
m_confdir = r.m_confdir;
|
||||
m_datadir = r.m_datadir;
|
||||
m_keydir = r.m_datadir;
|
||||
m_keydir = r.m_keydir;
|
||||
m_cdirs = r.m_cdirs;
|
||||
// We should use reference-counted objects instead!
|
||||
if (r.m_conf)
|
||||
m_conf = new ConfStack<ConfTree>(*(r.m_conf));
|
||||
@@ -891,6 +901,12 @@ void RclConfig::initFrom(const RclConfig& r)
|
||||
mimeconf = new ConfStack<ConfSimple>(*(r.mimeconf));
|
||||
if (r.mimeview)
|
||||
mimeview = new ConfStack<ConfSimple>(*(r.mimeview));
|
||||
if (r.m_fields)
|
||||
m_fields = new ConfStack<ConfSimple>(*(r.m_fields));
|
||||
m_fldtopfx = r.m_fldtopfx;
|
||||
m_aliastocanon = r.m_aliastocanon;
|
||||
m_storedFields = r.m_storedFields;
|
||||
m_xattrtofld = r.m_xattrtofld;
|
||||
if (r.m_stopsuffixes)
|
||||
m_stopsuffixes = new SuffixStore(*((SuffixStore*)r.m_stopsuffixes));
|
||||
m_maxsufflen = r.m_maxsufflen;
|
||||
|
||||
@@ -157,7 +157,9 @@ class RclConfig {
|
||||
const set<string>& getStoredFields() {return m_storedFields;}
|
||||
/** Get canonic name for possible alias */
|
||||
string fieldCanon(const string& fld);
|
||||
|
||||
/** Get xattr name to field names translations */
|
||||
const map<string, string>& getXattrToField() {return m_xattrtofld;}
|
||||
|
||||
/** mimeview: get/set external viewer exec string(s) for mimetype(s) */
|
||||
string getMimeViewerDef(const string &mimetype);
|
||||
bool getMimeViewerDefs(vector<pair<string, string> >&);
|
||||
@@ -205,6 +207,7 @@ class RclConfig {
|
||||
map<string, string> m_fldtopfx;
|
||||
map<string, string> m_aliastocanon;
|
||||
set<string> m_storedFields;
|
||||
map<string, string> m_xattrtofld;
|
||||
|
||||
void *m_stopsuffixes;
|
||||
unsigned int m_maxsufflen;
|
||||
|
||||
Reference in New Issue
Block a user