aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Steenbeek <m.o.steenbeek@gmail.com>2023-08-29 17:53:37 +0200
committerFelix Queißner <felix@ib-queissner.de>2023-08-30 08:43:16 +0200
commit3709c3d6bd90fdb42d4ff56b244b9f6ee8124569 (patch)
treecc7d3b18d65563715a507f09ea55aa08c6356a3c /src
parent10a9c4ccfac85c08b4682fcef24091569cb13f63 (diff)
Use startsWith() instead of left(4)
Diffstat (limited to 'src')
-rw-r--r--src/renderers/gophermaprenderer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/renderers/gophermaprenderer.cpp b/src/renderers/gophermaprenderer.cpp
index bd1e64d..9870271 100644
--- a/src/renderers/gophermaprenderer.cpp
+++ b/src/renderers/gophermaprenderer.cpp
@@ -157,8 +157,8 @@ std::unique_ptr<QTextDocument> GophermapRenderer::render(const QByteArray &input
{
QString dst_url;
- // If a resource’s link starts with “URL:”, it is a direct link (to HTTP or another protocol), rather than a file or directory on this server.
- if (items.size() >= 2 && items.at(1).left(4) == "URL:")
+ // If a resource’s path starts with “URL:”, it is a direct link (to HTTP or another protocol), rather than a file or directory on this server.
+ if (items.size() >= 2 && items.at(1).startsWith("URL:"))
{
auto item1 = QString(items.at(1));
item1.remove(0, 4);