blob: 57b5d8bec950bb632fb3463214eb50a2577e5d92 [file] [log] [blame]
agsantos90a1dbc2020-09-01 18:19:22 -04001/*!
2 * Copyright (C) 2020 by Savoir-faire Linux
3 * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "pluginadapter.h"
20
21#include "lrcinstance.h"
22
23PluginAdapter::PluginAdapter(QObject* parent)
24 : QmlAdapterBase(parent)
25{}
26
27QVariant
28PluginAdapter::getMediaHandlerSelectableModel()
29{
30 mediaHandlerListModel_.reset(new MediaHandlerItemListModel(this));
31 return QVariant::fromValue(mediaHandlerListModel_.get());
32}
33
34QVariant
35PluginAdapter::getPluginSelectableModel()
36{
37 pluginItemListModel_.reset(new PluginItemListModel(this));
38 return QVariant::fromValue(pluginItemListModel_.get());
39}
40
41QVariant
42PluginAdapter::getPluginPreferencesModel(const QString& pluginId, const QString& mediaHandlerName)
43{
44 preferenceItemListModel_.reset(new PreferenceItemListModel(this));
45 preferenceItemListModel_->setMediaHandlerName(mediaHandlerName);
46 preferenceItemListModel_->setPluginId(pluginId);
47
48 return QVariant::fromValue(preferenceItemListModel_.get());
49}