新增html文件文本内容解析及搜索功能;

This commit is contained in:
jixiaoxu 2022-04-26 10:25:23 +08:00 committed by iaom
parent 91bcdd6c18
commit ea46fc8199
3 changed files with 7 additions and 2 deletions

View File

@ -38,7 +38,8 @@ static const QMap<QString, bool> targetFileTypeMap = {
{"pps", true}, {"pps", true},
{"dps", true}, {"dps", true},
{"et", true}, {"et", true},
{"pdf", true} {"pdf", true},
{"html", true}
}; };
static const QMap<QString, bool> targetPhotographTypeMap = { static const QMap<QString, bool> targetPhotographTypeMap = {

View File

@ -945,6 +945,10 @@ bool FileUtils::isEncrypedOrUnreadable(QString path)
if(strsfx.endsWith("txt")) if(strsfx.endsWith("txt"))
return false; return false;
return true; return true;
} else if(name == "text/html") {
if(strsfx.endsWith("html"))
return false;
return true;
} else if(type.inherits("application/msword") || type.name() == "application/x-ole-storage") { } else if(type.inherits("application/msword") || type.name() == "application/x-ole-storage") {
if(strsfx == "doc" || strsfx == "dot" || strsfx == "wps" || strsfx == "ppt" || if(strsfx == "doc" || strsfx == "dot" || strsfx == "wps" || strsfx == "ppt" ||
strsfx == "pps" || strsfx == "dps" || strsfx == "et" || strsfx == "xls") { strsfx == "pps" || strsfx == "dps" || strsfx == "et" || strsfx == "xls") {

View File

@ -35,7 +35,7 @@ void FileReader::getTextContent(QString path, QString &textContent, QString &suf
FileUtils::getPptxTextContent(path, textContent); FileUtils::getPptxTextContent(path, textContent);
} else if (suffix == "xlsx") { } else if (suffix == "xlsx") {
FileUtils::getXlsxTextContent(path, textContent); FileUtils::getXlsxTextContent(path, textContent);
} else if (suffix == "txt") { } else if (strsfx == "txt" or strsfx == "html") {
FileUtils::getTxtContent(path, textContent); FileUtils::getTxtContent(path, textContent);
} else if (suffix == "doc" || suffix == "dot" || suffix == "wps" || suffix == "ppt" || } else if (suffix == "doc" || suffix == "dot" || suffix == "wps" || suffix == "ppt" ||
suffix == "pps" || suffix == "dps" || suffix == "et" || suffix == "xls") { suffix == "pps" || suffix == "dps" || suffix == "et" || suffix == "xls") {