Revert "Implemented per device resolution setting and selection"
[harmattan/cameraplus] / src / postcapturemodel.h
index be3eb8c..c5e0ce1 100644 (file)
@@ -3,7 +3,7 @@
 /*!
  * 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
@@ -24,7 +24,6 @@
 #define POST_CAPTURE_MODEL_H
 
 #include <QAbstractListModel>
-#include <QDeclarativeParserStatus>
 #include <QUrl>
 
 class QSparqlConnection;
@@ -34,9 +33,8 @@ class Quad;
 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);
@@ -49,9 +47,6 @@ public:
   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;
 
@@ -86,6 +81,14 @@ private:
 
   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 {
@@ -100,7 +103,7 @@ 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);
@@ -120,6 +123,8 @@ public:
   bool available() const;
   QString lastModified() const;
   unsigned trackerId() const;
+
+  void setFavorite(bool add);
   bool favorite() const;
 
 signals: