process rclaptg when searching mimeview allexcept

This commit is contained in:
Jean-Francois Dockes 2012-10-09 14:53:53 +02:00
parent c807184115
commit 4dba354273

View file

@ -825,8 +825,20 @@ string RclConfig::getMimeViewerDef(const string &mtype, const string& apptag,
string excepts = getMimeViewerAllEx(); string excepts = getMimeViewerAllEx();
vector<string> vex; vector<string> vex;
stringToTokens(excepts, vex); stringToTokens(excepts, vex);
vector<string>::iterator it = find(vex.begin(), vex.end(), mtype); bool isexcept = false;
if (it == vex.end()) { for (vector<string>::iterator it = vex.begin();
it != vex.end(); it++) {
vector<string> mita;
stringToTokens(*it, mita, "|");
if ((mita.size() == 1 && apptag.empty() && mita[0] == mtype) ||
(mita.size() == 2 && mita[1] == apptag && mita[0] == mtype)) {
// Exception to x-all
isexcept = true;
break;
}
}
if (isexcept == false) {
mimeview->get("application/x-all", hs, "view"); mimeview->get("application/x-all", hs, "view");
return hs; return hs;
} }