agsantos | 90a1dbc | 2020-09-01 18:19:22 -0400 | [diff] [blame^] | 1 | /*! |
| 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 | |
| 23 | PluginAdapter::PluginAdapter(QObject* parent) |
| 24 | : QmlAdapterBase(parent) |
| 25 | {} |
| 26 | |
| 27 | QVariant |
| 28 | PluginAdapter::getMediaHandlerSelectableModel() |
| 29 | { |
| 30 | mediaHandlerListModel_.reset(new MediaHandlerItemListModel(this)); |
| 31 | return QVariant::fromValue(mediaHandlerListModel_.get()); |
| 32 | } |
| 33 | |
| 34 | QVariant |
| 35 | PluginAdapter::getPluginSelectableModel() |
| 36 | { |
| 37 | pluginItemListModel_.reset(new PluginItemListModel(this)); |
| 38 | return QVariant::fromValue(pluginItemListModel_.get()); |
| 39 | } |
| 40 | |
| 41 | QVariant |
| 42 | PluginAdapter::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 | } |