From 9e6f634c5367896b93cfbd8cede53d4ee741aab9 Mon Sep 17 00:00:00 2001 From: Flavio Date: Mon, 28 Jan 2013 10:26:07 +0100 Subject: [PATCH] Fix suggester parent --- src/Suggester.h | 1 + src/channelsuggest.cpp | 15 +++------------ src/suggester.h | 1 + src/ytsuggester.cpp | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) 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) { } -- 2.39.5