From e2ec06a6122831eb59596d30acbc62ac46dc9c79 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 19 Jun 2021 09:56:23 +0200 Subject: [PATCH] GUI preview: try to use the file name (possibly from a zip internal path) as tab title if the document has no proper title --- src/qtgui/preview_w.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp index 34c9994c..d095ba51 100644 --- a/src/qtgui/preview_w.cpp +++ b/src/qtgui/preview_w.cpp @@ -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)); }