forked from openkylin/ukui-search
新增html文件文本内容解析及搜索功能;
This commit is contained in:
parent
91bcdd6c18
commit
ea46fc8199
|
@ -38,7 +38,8 @@ static const QMap<QString, bool> targetFileTypeMap = {
|
|||
{"pps", true},
|
||||
{"dps", true},
|
||||
{"et", true},
|
||||
{"pdf", true}
|
||||
{"pdf", true},
|
||||
{"html", true}
|
||||
};
|
||||
|
||||
static const QMap<QString, bool> targetPhotographTypeMap = {
|
||||
|
|
|
@ -945,6 +945,10 @@ bool FileUtils::isEncrypedOrUnreadable(QString path)
|
|||
if(strsfx.endsWith("txt"))
|
||||
return false;
|
||||
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") {
|
||||
if(strsfx == "doc" || strsfx == "dot" || strsfx == "wps" || strsfx == "ppt" ||
|
||||
strsfx == "pps" || strsfx == "dps" || strsfx == "et" || strsfx == "xls") {
|
||||
|
|
|
@ -35,7 +35,7 @@ void FileReader::getTextContent(QString path, QString &textContent, QString &suf
|
|||
FileUtils::getPptxTextContent(path, textContent);
|
||||
} else if (suffix == "xlsx") {
|
||||
FileUtils::getXlsxTextContent(path, textContent);
|
||||
} else if (suffix == "txt") {
|
||||
} else if (strsfx == "txt" or strsfx == "html") {
|
||||
FileUtils::getTxtContent(path, textContent);
|
||||
} else if (suffix == "doc" || suffix == "dot" || suffix == "wps" || suffix == "ppt" ||
|
||||
suffix == "pps" || suffix == "dps" || suffix == "et" || suffix == "xls") {
|
||||
|
|
Loading…
Reference in New Issue