summaryrefslogtreecommitdiff
path: root/community/goldendict/fix-wikipedia-images.patch
blob: ea28bcd910cc7b48b2ed85ea00e28e4f8014c0a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 8c056589e989781c6ed5aac7491c802414489ae9 Mon Sep 17 00:00:00 2001
From: Abs62 <ottomann@yandex.ru>
Date: Sat, 22 Oct 2011 15:52:52 +0400
Subject: [PATCH] Fix Wikipedia images loading

---
 mediawiki.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mediawiki.cc b/mediawiki.cc
index e67fdb3..9fff3dc 100644
--- a/mediawiki.cc
+++ b/mediawiki.cc
@@ -293,6 +293,9 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
             // Replace the href="/foo/bar/Baz" to just href="Baz".
             articleString.replace( QRegExp( "<a\\shref=\"/([\\w\\.]*/)*" ), "<a href=\"" );
   
+            // Add "http:" to image source urls
+            articleString.replace( " src=\"//", " src=\"http://" );
+
             // In those strings, change any underscores to spaces
             for( ; ; )
             {
-- 
1.8.4