🐞 fix(UI模块): 添加文件类型,修改文件图标显示
176100 【多端协同】A设备中新建wps文件,B设备在多端协同应用中查看此文件图标为问号图标且点击无法打开;177415 【单元测试】【多端协同】麒麟间建立连接后,无法直接在对端文件夹打开大文件和wps默认格式的文件
This commit is contained in:
parent
e86da602a5
commit
25ec014da7
|
@ -115,9 +115,11 @@ QMap<QString, QString> FileInfo::initMimeMap()
|
|||
map.insert("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
map.insert("doc", "application/msword");
|
||||
map.insert("xls", "application/vnd.ms-excel");
|
||||
map.insert("et", "application/vnd.ms-excel");
|
||||
map.insert("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
map.insert("pps", "application/vnd.ms-powerpoint");
|
||||
map.insert("ppt", "application/vnd.ms-powerpoint");
|
||||
map.insert("dps", "application/vnd.ms-powerpoint");
|
||||
map.insert("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
|
||||
map.insert("wps", "application/vnd.ms-works");
|
||||
map.insert("bin", "application/octet-stream");
|
||||
|
@ -170,6 +172,7 @@ QMap<QString, QString> FileInfo::initIconNameMap()
|
|||
map.insert("application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"application-vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
map.insert("application/msword", "application-msword");
|
||||
map.insert("application/vnd.ms-works", "application-msword");
|
||||
map.insert("application/vnd.ms-excel", "application-vnd.ms-excel");
|
||||
map.insert("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application-vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
|
@ -356,6 +359,7 @@ void FileInfo::setDate(const QString &date)
|
|||
}
|
||||
QString FileInfo::getContentType() const
|
||||
{
|
||||
qDebug() << m_name << m_type << m_contentType;
|
||||
return m_contentType;
|
||||
}
|
||||
|
||||
|
@ -376,16 +380,16 @@ FileInfo::FileType FileInfo::judgmentType(QString fileName)
|
|||
} else if (mime.name().startsWith("video/")) {
|
||||
// 视频 video/mp4, video/x-flv, video/webm, video/ogg
|
||||
return FileType::Video;
|
||||
} else if (fileType == "doc" || fileType == "docx") {
|
||||
} else if (fileType == "doc" || fileType == "docx" || fileType == "wps") {
|
||||
// word doc docx
|
||||
return FileType::Doc;
|
||||
} else if (fileType == "pdf") {
|
||||
// pdf
|
||||
return FileType::Pdf;
|
||||
} else if (fileType == "xlsx" || fileType == "xls") {
|
||||
} else if (fileType == "xlsx" || fileType == "xls" || fileType == "et") {
|
||||
// excel
|
||||
return FileType::Excel;
|
||||
} else if (fileType == "pptx") {
|
||||
} else if (fileType == "pptx" || fileType == "dps") {
|
||||
// ppt
|
||||
return FileType::Ppt;
|
||||
} else if (fileType == "zip") {
|
||||
|
|
Loading…
Reference in New Issue