Camera doesn't need to subclass QDeclarativeItem
[harmattan/cameraplus] / declarative / camera.cpp
index 0058c13..c04741b 100644 (file)
@@ -50,8 +50,8 @@
 #include "videotorch.h"
 #include "cameraconfig.h"
 
-Camera::Camera(QDeclarativeItem *parent) :
-  QDeclarativeItem(parent),
+Camera::Camera(QObject *parent) :
+  QObject(parent),
   m_cam(new QtCamera(this)),
   m_dev(0),
   m_mode(Camera::UnknownMode),
@@ -106,12 +106,6 @@ Camera::~Camera() {
   delete m_videoTorch;
 }
 
-void Camera::componentComplete() {
-  QDeclarativeItem::componentComplete();
-
-  emit deviceCountChanged();
-}
-
 int Camera::deviceCount() const {
   return m_cam ? m_cam->devices().size() : 0;
 }
@@ -130,11 +124,6 @@ bool Camera::reset(const QVariant& deviceId, const CameraMode& mode) {
     return false;
   }
 
-  if (!isComponentComplete()) {
-    qmlInfo(this) << "Component is still not ready";
-    return false;
-  }
-
   QVariant oldId = m_id;
   Camera::CameraMode oldMode = m_mode;