diff --git a/src/radio/lastfmstationdialog.cpp b/src/radio/lastfmstationdialog.cpp index 3351f40b8..5a58ada8c 100644 --- a/src/radio/lastfmstationdialog.cpp +++ b/src/radio/lastfmstationdialog.cpp @@ -17,64 +17,6 @@ #include "lastfmstationdialog.h" #include "ui_lastfmstationdialog.h" -#include -#include -#include - -#include -#include - -#include -#include - -namespace { - -namespace qi = boost::spirit::qi; -using boost::spirit::lit; - -template -struct rql : qi::grammar >()> { - rql() : rql::base_type(query) { - query = pair % lit(' ') >> qi::eoi; - pair = key >> lit(':') >> value; - key = qi::string("simart") | - qi::string("tag") | - qi::string("user") | - qi::string("library") | - qi::string("loved"); - value = (unquoted | quoted); - unquoted = +(qi::char_ - lit(' ') - lit('"')); - quoted = '"' >> +(qi::char_ - '"') >> '"'; - } - - qi::rule >()> query; - qi::rule()> pair; - qi::rule key; - qi::rule value, unquoted, quoted; -}; - -class RQLValidator : public QValidator { - public: - QValidator::State validate(QString& str, int& pos) const { - std::string input = str.toStdString(); - rql parser; - std::vector > results; - bool ret = qi::parse(input.begin(), input.end(), parser, results); - - qDebug() << "Success:" << ret; - - for (std::vector >::const_iterator it = results.begin(); - it != results.end(); ++it) { - qDebug("key:%s value:%s", it->first.c_str(), it->second.c_str()); - } - qDebug() << "---"; - - return ret ? Acceptable : Intermediate; - } -}; - -} // namespace - LastFMStationDialog::LastFMStationDialog(QWidget* parent) : QDialog(parent), ui_(new Ui_LastFMStationDialog) @@ -82,8 +24,6 @@ LastFMStationDialog::LastFMStationDialog(QWidget* parent) ui_->setupUi(this); resize(sizeHint()); - - ui_->content->setValidator(new RQLValidator()); } LastFMStationDialog::~LastFMStationDialog() { @@ -99,6 +39,3 @@ void LastFMStationDialog::SetType(Type type) { QString LastFMStationDialog::content() const { return ui_->content->text(); } - -void LastFMStationDialog::accept() { -} diff --git a/src/radio/lastfmstationdialog.h b/src/radio/lastfmstationdialog.h index 62172675b..efc7a9195 100644 --- a/src/radio/lastfmstationdialog.h +++ b/src/radio/lastfmstationdialog.h @@ -37,9 +37,6 @@ class LastFMStationDialog : public QDialog { void SetType(Type type); QString content() const; - public slots: - virtual void accept(); - private: Ui_LastFMStationDialog* ui_; };