diff options
Diffstat (limited to 'sigtools/PluginTypeModel.cpp')
-rw-r--r-- | sigtools/PluginTypeModel.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/sigtools/PluginTypeModel.cpp b/sigtools/PluginTypeModel.cpp new file mode 100644 index 00000000..fecf5610 --- /dev/null +++ b/sigtools/PluginTypeModel.cpp @@ -0,0 +1,68 @@ +/* + * Copyright 2009 Ben Boeckel <MathStuf@gmail.com> + * + * This program 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. + * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "PluginTypeModel.h" + +// Sigtools includes +#include "PluginModel.h" +#include "RootPluginModel.h" + +// Qt includes +#include <QtCore/QSize> + +using namespace Sigtools; + +PluginTypeModel::PluginTypeModel(const QString& type, RootPluginModel* parent) : + BaseModel(parent), + m_type(type) +{ +} + +int PluginTypeModel::rowCount() const +{ + return m_services.size(); +} + +Qt::ItemFlags PluginTypeModel::flags() const +{ + return Qt::ItemIsEnabled; +} + +void PluginTypeModel::paint(QPainter* painter, const QStyleOptionViewItem& option) const +{ +} + +QSize PluginTypeModel::sizeHint(const QStyleOptionViewItem& option) const +{ +} + +BaseModel* PluginTypeModel::childItem(const int row) +{ + if ((0 <= row) && (row < m_services.size())) + return m_services[row]; + return NULL; +} + +void PluginTypeModel::addPlugin(KService::Ptr service) +{ +} + +int PluginTypeModel::findChild(BaseModel* model) const +{ + return m_services.indexOf(qobject_cast<PluginModel*>(model)); +} |