mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix/pdf_name_ascii (#2341)
* fix/pdf_name_ascii * adj * Update src/widgets/pdfviewwindow.cpp --------- Co-authored-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
f1a03554f0
commit
075380749c
@ -119,7 +119,8 @@ void PdfViewWindow::syncEditorFromBuffer()
|
|||||||
auto buffer = getBuffer();
|
auto buffer = getBuffer();
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
const auto url = PathUtils::pathToUrl(buffer->getContentPath());
|
const auto url = PathUtils::pathToUrl(buffer->getContentPath());
|
||||||
const auto urlStr = url.toString(QUrl::EncodeSpaces);
|
// Solution to ASCII problems, like these file names with these symbols # + &.
|
||||||
|
const auto urlStr = QUrl::toPercentEncoding(url.toString(QUrl::FullyDecoded));
|
||||||
auto templateUrl = PathUtils::pathToUrl(HtmlTemplateHelper::getPdfViewerTemplatePath());
|
auto templateUrl = PathUtils::pathToUrl(HtmlTemplateHelper::getPdfViewerTemplatePath());
|
||||||
templateUrl.setQuery("file=" + urlStr);
|
templateUrl.setQuery("file=" + urlStr);
|
||||||
m_viewer->setHtml(HtmlTemplateHelper::getPdfViewerTemplate(), templateUrl);
|
m_viewer->setHtml(HtmlTemplateHelper::getPdfViewerTemplate(), templateUrl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user