diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-01-11 18:18:24 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-11 20:29:21 +0100 |
| commit | db0202cc36512f30c7a20068834d37bf8e6490a3 (patch) | |
| tree | e94ce2fda1534479b0e207606c2e26b0c1c31076 /src/browsertab.cpp | |
| parent | c635094a6bdfcf2f081eb3c0ed9a1454ae2933fb (diff) | |
Revert "Fixes a 'resource not found' bug"
That commit broke resolving relative urls (e.g. when you were browsing
README.md, the link that goes to BUILDING resolved to README.md/BUILDING).
This reverts commit 601887655e7f128c1c938a24fc38d002a8aecb64.
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index faae7dd..ef3bb48 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -556,20 +556,11 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) // Only cache text pages bool will_cache = true; - // We always give trailing slashes to the renderers - // since QUrl.resolve will not create absolute URLs properly - // without them. - QUrl cur_url = current_location; - if (cur_url.path().isEmpty()) - cur_url.setPath("/"); - else if (cur_url.path()[cur_url.path().length() - 1] != "/") - cur_url.setPath(cur_url.path() + "/"); - if (not plaintext_only and mime.is("text", "gemini")) { document = GeminiRenderer::render( data, - cur_url, + this->current_location, doc_style, this->outline, &this->page_title); @@ -578,7 +569,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) { document = GophermapRenderer::render( data, - cur_url, + this->current_location, doc_style); } else if (not plaintext_only and mime.is("text","html")) @@ -624,7 +615,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) document = GeminiRenderer::render( src.readAll(), - cur_url, + this->current_location, preview_style, this->outline); @@ -637,7 +628,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) { document = MarkdownRenderer::render( data, - cur_url, + this->current_location, doc_style, this->outline, this->page_title); @@ -684,7 +675,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) else if (mime.is("video") or mime.is("audio")) { doc_type = Media; - this->ui->media_browser->setMedia(data, cur_url, mime.type); + this->ui->media_browser->setMedia(data, this->current_location, mime.type); will_cache = false; } @@ -726,7 +717,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) document = GeminiRenderer::render( page_data.toUtf8(), - cur_url, + this->current_location, doc_style, this->outline, &this->page_title); |
