add <pre> tag to text/plain translated into qt html to preserve indentation. Removes need for rcltext (which did just this). Allow specifying any text/xxx as internal (allows having specific editor but no filter)

This commit is contained in:
dockes
2009-11-30 10:04:27 +00:00
parent 6eaed467b0
commit 93d0aa3fee
8 changed files with 164 additions and 94 deletions
+13 -5
View File
@@ -50,16 +50,24 @@ static Dijon::Filter *mhFactory(const string &mime)
{
string lmime(mime);
stringtolower(lmime);
if ("text/plain" == lmime)
if ("text/plain" == lmime) {
return new MimeHandlerText(lmime);
else if ("text/html" == lmime)
} else if ("text/html" == lmime) {
return new MimeHandlerHtml(lmime);
else if ("text/x-mail" == lmime)
} else if ("text/x-mail" == lmime) {
return new MimeHandlerMbox(lmime);
else if ("message/rfc822" == lmime)
} else if ("message/rfc822" == lmime) {
return new MimeHandlerMail(lmime);
else
} else if (lmime.find("text/") == 0) {
// Try to handle unknown text/xx as text/plain. This
// only happen if the text/xx was defined as "internal" in
// mimeconf, not at random. For programs, for example this
// allows indexing and previewing as text/plain (no filter
// exec) but still opening with a specific editor.
return new MimeHandlerText(lmime);
} else {
return new MimeHandlerUnknown(lmime);
}
}
/**