QTfrontend/databrowser.cpp
changeset 5780 528dd4a14861
parent 5772 c09c50efe8b5
--- a/QTfrontend/databrowser.cpp	Sun Sep 04 17:26:38 2011 -0400
+++ b/QTfrontend/databrowser.cpp	Mon Sep 05 15:49:14 2011 +0400
@@ -2,6 +2,7 @@
 #include <QNetworkRequest>
 #include <QNetworkReply>
 #include <QDebug>
+#include <QUrl>
 
 #include "databrowser.h"
 
@@ -19,15 +20,15 @@
 {
     if(type == QTextDocument::ImageResource || type == QTextDocument::StyleSheetResource)
     {
-        if(resources.contains(name))
+        if(resources.contains(name.toString()))
         {
-            return resources.take(name);
+            return resources.take(name.toString());
         }
         else
-            if(!requestedResources.contains(name))
+            if(!requestedResources.contains(name.toString()))
             {
                 qDebug() << "Requesting resource" << name.toString();
-                requestedResources.insert(name);
+                requestedResources.insert(name.toString());
 
                 QNetworkRequest newRequest(QUrl("http://www.hedgewars.org" + name.toString()));
                 newRequest.setAttribute(typeAttribute, type);
@@ -49,7 +50,7 @@
     {
         int type = reply->request().attribute(typeAttribute).toInt();
         QUrl url = reply->request().attribute(urlAttribute).toUrl();
-        resources.insert(url, reply->readAll());
+        resources.insert(url.toString(), reply->readAll());
         document()->addResource(type, reply->request().url(), QVariant());
         update();
     }