truncate page on comment tags, as suggested by unc0rr
authornemo
Sun, 04 Sep 2011 12:19:31 -0400
changeset 5764 d785d7e23113
parent 5763 d7a887c7e2d0
child 5765 e87f6756773e
truncate page on comment tags, as suggested by unc0rr
QTfrontend/pagedata.cpp
--- a/QTfrontend/pagedata.cpp	Sun Sep 04 12:06:10 2011 -0400
+++ b/QTfrontend/pagedata.cpp	Sun Sep 04 12:19:31 2011 -0400
@@ -76,10 +76,13 @@
 void PageDataDownload::pageDownloaded()
 {
     QNetworkReply * reply = qobject_cast<QNetworkReply *>(sender());
+    QString html = QString::fromUtf8(reply->readAll());
+    html.remove(0,html.indexOf("<!-- BEGIN -->"));
+    html.truncate(html.indexOf("<!-- END -->"));
 
     if(reply)
     {
-        web->setHtml(QString::fromUtf8(reply->readAll()));
+        web->setHtml(html);
     }
 }
 
@@ -120,7 +123,8 @@
 
 void PageDataDownload::fetchList()
 {
-    QNetworkRequest newRequest(QUrl("http://hedgewars.org/node/2833"));
+    //QNetworkRequest newRequest(QUrl("http://hedgewars.org/node/2833"));
+    QNetworkRequest newRequest(QUrl("http://hedgewars.org/content.html"));
 
     QNetworkAccessManager *manager = new QNetworkAccessManager(this);
     QNetworkReply *reply = manager->get(newRequest);