]> git.sur5r.net Git - minitube/commitdiff
Fix suggester parent
authorFlavio <flavio@odisseo.local>
Mon, 28 Jan 2013 09:26:07 +0000 (10:26 +0100)
committerFlavio <flavio@odisseo.local>
Mon, 28 Jan 2013 09:27:20 +0000 (10:27 +0100)
src/Suggester.h
src/channelsuggest.cpp
src/suggester.h
src/ytsuggester.cpp

index d95d026ca4a30fa9df47a62bdfde73a4e7a9a5c9..ad39f92dba8814eb680972480281716534fc1937 100644 (file)
@@ -8,6 +8,7 @@ class Suggester : public QObject {
     Q_OBJECT
 
 public:
+    Suggester(QObject *parent = 0) : QObject(parent) { }
     virtual void suggest(QString query) = 0;
 
 signals:
index ccec4a0eb6cba73455aac9fc15ae1eef8ccf9170..757c5348e5ddc23f4589f589a2e737c9340a5140 100644 (file)
@@ -5,23 +5,14 @@ namespace The {
     NetworkAccess* http();
 }
 
-ChannelSuggest::ChannelSuggest(QObject *parent) : Suggester() {
+ChannelSuggest::ChannelSuggest(QObject *parent) : Suggester(parent) {
 
 }
 
 void ChannelSuggest::suggest(QString query) {
-
-    /* // TODO how to localize results?
-    QString locale = QLocale::system().name().replace("_", "-");
-    // case for system locales such as "C"
-    if (locale.length() < 2) {
-        locale = "en-US";
-    }*/
-
-    QUrl url("http://www.youtube.com/results?search_type=search_users");
+    QUrl url("http://www.youtube.com/results");
+    url.addQueryItem("search_type", "search_users");
     url.addQueryItem("search_query", query);
-    // url.addQueryItem("hl", "it-IT");
-
     QObject *reply = The::http()->get(url);
     connect(reply, SIGNAL(data(QByteArray)), SLOT(handleNetworkData(QByteArray)));
 }
index d95d026ca4a30fa9df47a62bdfde73a4e7a9a5c9..ad39f92dba8814eb680972480281716534fc1937 100644 (file)
@@ -8,6 +8,7 @@ class Suggester : public QObject {
     Q_OBJECT
 
 public:
+    Suggester(QObject *parent = 0) : QObject(parent) { }
     virtual void suggest(QString query) = 0;
 
 signals:
index b0693d8221bc186a2d6bb6dc9a9d20247b8d305e..a1cfe98f1432a15b6ff2d186f18d374ded588554 100644 (file)
@@ -8,7 +8,7 @@ namespace The {
     NetworkAccess* http();
 }
 
-YTSuggester::YTSuggester(QObject *parent) : Suggester() {
+YTSuggester::YTSuggester(QObject *parent) : Suggester(parent) {
 
 }