X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fsearchparams.cpp;h=2fea09c43af4a56f56daff685cbb523f9b5e90ed;hb=8cea1b650a0122369e8a3d60da1f263767b67614;hp=800e248244ab55992184b8fc66ef69bb96f572e3;hpb=57c25e20a8f10a98a18dbc2b64ce55cf87d4fd7c;p=minitube diff --git a/src/searchparams.cpp b/src/searchparams.cpp index 800e248..2fea09c 100644 --- a/src/searchparams.cpp +++ b/src/searchparams.cpp @@ -1,6 +1,36 @@ +/* $BEGIN_LICENSE + +This file is part of Minitube. +Copyright 2009, Flavio Tordini + +Minitube is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Minitube is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Minitube. If not, see . + +$END_LICENSE */ + #include "searchparams.h" -SearchParams::SearchParams() { - m_sortBy = SortByRelevance; +SearchParams::SearchParams(QObject *parent) : QObject(parent) { m_transient = false; + m_sortBy = SortByRelevance; + m_duration = DurationAny; + m_quality = QualityAny; + m_time = TimeAny; + m_publishedAfter = 0; + m_safeSearch = Moderate; +} + +void SearchParams::setParam(const QString &name, const QVariant &value) { + bool success = setProperty(name.toUtf8(), value); + if (!success) qWarning() << "Failed to set property" << name << value.toString(); }