Fixed errors in Remote
authorJari Jarvi <t7jaja00@students.oamk.fi>
Fri, 18 Jun 2010 08:50:00 +0000 (11:50 +0300)
committerJari Jarvi <t7jaja00@students.oamk.fi>
Fri, 18 Jun 2010 08:50:00 +0000 (11:50 +0300)
src/remote.cpp
src/remote.h

index b6d623b..af46cda 100644 (file)
@@ -6,7 +6,7 @@
 #include <QNetworkRequest>
 #include <QUrl>
 
-Remote::Remote(const Remote::QString &name)
+Remote::Remote(const QString &name)
     : m_name(name)
 {
 }
@@ -26,7 +26,7 @@ void Remote::updateInfo()
 {
     QSettings settings;
     if (m_name != "") {
-        m_infoNAM->get(QNetworkRequest(QUrl(
+        m_infoNAM.get(QNetworkRequest(QUrl(
               settings.value("baseUrl").toString() 
                 + "vote/get?name=" 
                 + m_name )));
@@ -37,12 +37,13 @@ void Remote::sendRating(Rating::Rating r)
 {
     QSettings settings;
     if (m_name != "") {
-        m_ratingNAM->get(QNetworkRequest(QUrl(
-              settings.value("baseUrl").toString() 
-                + "vote/"
-                + r == Rating::Up ? "up" : "down"
-                + "?name=" 
-                + m_name )));
+        m_ratingNAM.get(QNetworkRequest(QUrl(
+            settings.value("baseUrl",
+                "http://mercury.wipsl.com/irwi/db.xml").toString() 
+            + "vote/"
+            + ((r == Rating::Up) ? "up" : "down")
+            + "?name=" 
+            + m_name)));
     }
 }
 
index a104ff1..4619246 100644 (file)
@@ -12,7 +12,7 @@ namespace Rating {
     Rating Down = false;
 }
 
-class Remote
+class Remote : public QObject
 {
     Q_OBJECT
 public:
@@ -46,8 +46,8 @@ private:
 
     void init();
     
-    void Remote::remoteDownloadFinished(QNetworkReply *reply);
-    void Remote::infoRequestFinished(QNetworkReply *reply);
+    void remoteDownloadFinished(QNetworkReply *reply);
+    void infoRequestFinished(QNetworkReply *reply);
 };
 
 #endif