/*!
* This file is part of CameraPlus.
*
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#define POST_CAPTURE_MODEL_H
#include <QAbstractListModel>
-#include <QDeclarativeParserStatus>
#include <QUrl>
class QSparqlConnection;
class QSparqlQuery;
class QSparqlResultRow;
-class PostCaptureModel : public QAbstractListModel, public QDeclarativeParserStatus {
+class PostCaptureModel : public QAbstractListModel {
Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus);
Q_PROPERTY(QString manufacturer READ manufacturer WRITE setManufacturer NOTIFY manufacturerChanged);
Q_PROPERTY(QString model READ model WRITE setModel NOTIFY modelChanged);
PostCaptureModel(QObject *parent = 0);
~PostCaptureModel();
- virtual void classBegin();
- virtual void componentComplete();
-
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
QList<PostCaptureModelItem *> m_items;
QHash<int, PostCaptureModelItem *> m_hash;
+
+ bool m_connected;
+
+#if defined(QT5)
+ QHash<int, QByteArray> roleNames() const;
+ void setRoleNames(const QHash<int, QByteArray>& roles);
+ QHash<int, QByteArray> m_roles;
+#endif
};
class PostCaptureModelItem : public QObject {
Q_PROPERTY(bool available READ available NOTIFY availableChanged);
Q_PROPERTY(QString lastModified READ lastModified NOTIFY lastModifiedChanged);
Q_PROPERTY(unsigned trackerId READ trackerId CONSTANT);
- Q_PROPERTY(bool favorite READ favorite NOTIFY favoriteChanged);
+ Q_PROPERTY(bool favorite READ favorite WRITE setFavorite NOTIFY favoriteChanged);
public:
PostCaptureModelItem(const QSparqlResultRow& row, QObject *parent = 0);
bool available() const;
QString lastModified() const;
unsigned trackerId() const;
+
+ void setFavorite(bool add);
bool favorite() const;
signals: