Get rid of meego InfoBanner usage and move to a home grown component
[harmattan/cameraplus] / lib / qtcamdevice.cpp
index a8e180c..ed00c5e 100644 (file)
@@ -29,7 +29,6 @@
 #include "qtcamimagemode.h"
 #include "qtcamvideomode.h"
 #include "qtcamnotifications.h"
-#include "gst/gstcopy.h"
 #include "qtcampropertysetter.h"
 #include "qtcamanalysisbin.h"
 
@@ -37,12 +36,6 @@ QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
                         const QVariant& id, QObject *parent) :
   QObject(parent), d_ptr(new QtCamDevicePrivate) {
 
-  static gboolean register_copy = TRUE;
-  if (register_copy) {
-    qt_cam_copy_register();
-    register_copy = FALSE;
-  }
-
   d_ptr->q_ptr = this;
   d_ptr->name = name;
   d_ptr->id = id;
@@ -148,20 +141,18 @@ bool QtCamDevice::setViewfinder(QtCamViewfinder *viewfinder) {
   }
 
   if (!viewfinder) {
-    qWarning() << "QtCamDevice: viewfinder cannot be unset.";
-    return false;
-  }
+    if (d_ptr->cameraBin) {
+      g_object_set(d_ptr->cameraBin, "viewfinder-sink", NULL, NULL);
+    }
 
-  if (d_ptr->viewfinder) {
-    qWarning() << "QtCamDevice: viewfinder cannot be replaced.";
-    return false;
-  }
+    d_ptr->sink = 0;
 
-  if (!viewfinder->setDevice(this)) {
-    return false;
+    d_ptr->viewfinder = 0;
+    return true;
   }
 
   d_ptr->viewfinder = viewfinder;
+  d_ptr->sink = 0;
 
   return true;
 }