X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=e3ab1abb408f148b90979c36b715b6c2e458f07d;hp=e255d002c614111f7818e5a456d2e889497758ca;hb=d36a37a4a2e2fa889cf12d596258f9ba4dfcc5ed;hpb=906391224228274450914361efd104630827e580 diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index e255d002..e3ab1abb 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -636,9 +636,10 @@ void ContentsChatItem::showWebPreview(const Clickable &click) { QPointF topLeft = scenePos() + QPointF(x, y); QRectF urlRect = QRectF(topLeft.x(), topLeft.y(), width, height); - QString url = data(ChatLineModel::DisplayRole).toString().mid(click.start(), click.length()); - if(!url.contains("://")) - url = "http://" + url; + QString urlstr = data(ChatLineModel::DisplayRole).toString().mid(click.start(), click.length()); + if(!urlstr.contains("://")) + urlstr= "http://" + urlstr; + QUrl url = QUrl::fromEncoded(urlstr.toUtf8(), QUrl::TolerantMode); chatScene()->loadWebPreview(this, url, urlRect); #endif }