diff options
Diffstat (limited to 'sigtools/PluginTreeModel.h')
-rw-r--r-- | sigtools/PluginTreeModel.h | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/sigtools/PluginTreeModel.h b/sigtools/PluginTreeModel.h index fd17fef6..04c896ec 100644 --- a/sigtools/PluginTreeModel.h +++ b/sigtools/PluginTreeModel.h @@ -21,47 +21,36 @@ // Sigtools includes #include "Global.h" -// KDE includes -#include <KPluginInfo> - // Qt includes -#include <QtCore/QList> -#include <QtCore/QPair> -#include <QtCore/QAbstractItemModel> +#include <QtCore/QAbstractListModel> #include <QtGui/QIcon> -// Forward declarations -class KPluginFactory; - namespace Sigtools { -class BaseModel; class PluginTree; -class RootPluginModel; -class SIGTOOLS_NO_EXPORT PluginTreeModel : public QAbstractItemModel +class SIGTOOLS_NO_EXPORT PluginTreeModel : public QAbstractListModel { Q_OBJECT public: - PluginTreeModel(PluginTree* browser); - ~PluginTreeModel(); - - QVariant data(const QModelIndex& index, int role) const; + struct ClassData + { + QString m_type; + QString m_name; + QString m_description; + QIcon m_icon; + }; - QModelIndex index(int row, int column, const QModelIndex& parent) const; - QModelIndex parent(const QModelIndex& index) const; + PluginTreeModel(const QStringList& types, PluginTree* tree); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - - Qt::ItemFlags flags(const QModelIndex& index) const; + QModelIndex index(const int row, const int column = 0, const QModelIndex& parent = QModelIndex()) const; - BaseModel* getItem(const QModelIndex& index) const; + QVariant data(const QModelIndex& index, const int role = Qt::DisplayRole) const; - void addPlugin(const QString& type, KService::Ptr service); + int rowCount(const QModelIndex& parent = QModelIndex()) const; private: - RootPluginModel* m_root; + QList<ClassData> m_entries; }; } |