Add count property to ImageResolutionModel and VideoResolutionModel
[harmattan/cameraplus] / declarative / imageresolutionmodel.cpp
index d0e0b19..54f8043 100644 (file)
@@ -1,7 +1,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
@@ -105,5 +105,20 @@ void ImageResolutionModel::setAspectRatio(const QString& aspectRatio) {
     endResetModel();
 
     emit aspectRatioChanged();
+    emit countChanged();
   }
 }
+
+int ImageResolutionModel::count() const {
+  return rowCount();
+}
+
+#if defined(QT5)
+QHash<int, QByteArray> ImageResolutionModel::roleNames() const {
+  return m_roles;
+}
+
+void ImageResolutionModel::setRoleNames(const QHash<int, QByteArray>& roles) {
+  m_roles = roles;
+}
+#endif