GUI preview: try to use the file name (possibly from a zip internal path) as tab title if the document has no proper title

This commit is contained in:
Jean-Francois Dockes 2021-06-19 09:56:23 +02:00
parent ffe455d489
commit e2ec06a612

View File

@ -537,7 +537,9 @@ void Preview::setCurTabProps(const Rcl::Doc &doc, int docnum)
QString title;
string ctitle;
if (doc.getmeta(Rcl::Doc::keytt, &ctitle) && !ctitle.empty()) {
title = QString::fromUtf8(ctitle.c_str(), ctitle.length());
title = u8s2qs(ctitle);
} else if (doc.getmeta(Rcl::Doc::keyfn, &ctitle) && !ctitle.empty()) {
title = u8s2qs(ctitle);
} else {
title = path2qs(path_getsimple(doc.url));
}