From: Flavio Date: Mon, 28 Jan 2013 09:26:07 +0000 (+0100) Subject: Fix suggester parent X-Git-Tag: 2.0~25 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9e6f634c5367896b93cfbd8cede53d4ee741aab9;p=minitube Fix suggester parent --- diff --git a/src/Suggester.h b/src/Suggester.h index d95d026..ad39f92 100644 --- a/src/Suggester.h +++ b/src/Suggester.h @@ -8,6 +8,7 @@ class Suggester : public QObject { Q_OBJECT public: + Suggester(QObject *parent = 0) : QObject(parent) { } virtual void suggest(QString query) = 0; signals: diff --git a/src/channelsuggest.cpp b/src/channelsuggest.cpp index ccec4a0..757c534 100644 --- a/src/channelsuggest.cpp +++ b/src/channelsuggest.cpp @@ -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))); } diff --git a/src/suggester.h b/src/suggester.h index d95d026..ad39f92 100644 --- a/src/suggester.h +++ b/src/suggester.h @@ -8,6 +8,7 @@ class Suggester : public QObject { Q_OBJECT public: + Suggester(QObject *parent = 0) : QObject(parent) { } virtual void suggest(QString query) = 0; signals: diff --git a/src/ytsuggester.cpp b/src/ytsuggester.cpp index b0693d8..a1cfe98 100644 --- a/src/ytsuggester.cpp +++ b/src/ytsuggester.cpp @@ -8,7 +8,7 @@ namespace The { NetworkAccess* http(); } -YTSuggester::YTSuggester(QObject *parent) : Suggester() { +YTSuggester::YTSuggester(QObject *parent) : Suggester(parent) { }