Allow setting fields in fs subtree. Use for an application tag used for starting a specialized viewer

This commit is contained in:
dockes
2009-10-30 10:16:37 +00:00
parent e7dfd57d6e
commit 4d0e860a04
5 changed files with 25 additions and 10 deletions
+8 -4
View File
@@ -386,7 +386,7 @@ bool RclConfig::inStopSuffixes(const string& fni)
}
}
string RclConfig::getMimeTypeFromSuffix(const string &suff)
string RclConfig::getMimeTypeFromSuffix(const string& suff)
{
string mtype;
mimemap->get(suff, mtype, m_keydir);
@@ -611,10 +611,14 @@ string RclConfig::fieldCanon(const string& f)
return fld;
}
string RclConfig::getMimeViewerDef(const string &mtype)
string RclConfig::getMimeViewerDef(const string &mtype, const string& apptag)
{
LOGDEB(("RclConfig::getMimeViewerDef: mtype %s apptag %s\n",
mtype.c_str(), apptag.c_str()));
string hs;
mimeview->get(mtype, hs, "view");
if (apptag.empty() || !mimeview->get(mtype + string("|") + apptag,
hs, "view"))
mimeview->get(mtype, hs, "view");
return hs;
}
@@ -624,7 +628,7 @@ bool RclConfig::getMimeViewerDefs(vector<pair<string, string> >& defs)
return false;
list<string>tps = mimeview->getNames("view");
for (list<string>::const_iterator it = tps.begin(); it != tps.end();it++) {
defs.push_back(pair<string, string>(*it, getMimeViewerDef(*it)));
defs.push_back(pair<string, string>(*it, getMimeViewerDef(*it, "")));
}
return true;
}
+1 -1
View File
@@ -176,7 +176,7 @@ class RclConfig {
const map<string, string>& getXattrToField() {return m_xattrtofld;}
/** mimeview: get/set external viewer exec string(s) for mimetype(s) */
string getMimeViewerDef(const string &mimetype);
string getMimeViewerDef(const string &mimetype, const string& apptag);
bool getMimeViewerDefs(vector<pair<string, string> >&);
bool setMimeViewerDef(const string& mimetype, const string& cmd);