Rename Notifications to DeclarativeQtCameraNotifications
authorMohammed Sameer <msameer@foolab.org>
Mon, 4 Feb 2013 19:03:30 +0000 (21:03 +0200)
committerMohammed Sameer <msameer@foolab.org>
Mon, 4 Feb 2013 19:13:21 +0000 (21:13 +0200)
Also move constructor and distructor implementation to the header file.

declarative/camera.cpp
declarative/camera.h
declarative/declarative.pro
declarative/declarativeqtcameranotifications.h [moved from declarative/notifications.h with 74% similarity]
declarative/notifications.cpp [deleted file]
declarative/notificationscontainer.cpp
declarative/notificationscontainer.h
declarative/plugin.cpp
declarative/sounds.h

index a20f9ac..07f3801 100644 (file)
@@ -26,7 +26,7 @@
 #include "qtcamvideomode.h"
 #include "qtcamgraphicsviewfinder.h"
 #include "qtcamconfig.h"
-#include "notifications.h"
+#include "declarativeqtcameranotifications.h"
 #include "notificationscontainer.h"
 #include "sounds.h"
 #include <QDeclarativeInfo>
@@ -274,11 +274,11 @@ QString Camera::videoSuffix() const {
   return m_cam->config()->videoSuffix();
 }
 
-Notifications *Camera::notifications() const {
+DeclarativeQtCameraNotifications *Camera::notifications() const {
   return m_notifications->notifications();
 }
 
-void Camera::setNotifications(Notifications *notifications) {
+void Camera::setNotifications(DeclarativeQtCameraNotifications *notifications) {
   if (m_notifications->setNotifications(notifications)) {
 
     if (Sounds *s = dynamic_cast<Sounds *>(notifications)) {
index 232ad9e..e1fbc1d 100644 (file)
@@ -30,7 +30,7 @@
 class QtCamera;
 class QtCamDevice;
 class QtCamGraphicsViewfinder;
-class Notifications;
+class DeclarativeQtCameraNotifications;
 class NotificationsContainer;
 class Zoom;
 class Flash;
@@ -59,7 +59,7 @@ class Camera : public QDeclarativeItem {
   Q_PROPERTY(bool running READ isRunning NOTIFY runningStateChanged);
   Q_PROPERTY(QString imageSuffix READ imageSuffix CONSTANT);
   Q_PROPERTY(QString videoSuffix READ videoSuffix CONSTANT);
-  Q_PROPERTY(Notifications *notifications READ notifications WRITE setNotifications NOTIFY notificationsChanged);
+  Q_PROPERTY(DeclarativeQtCameraNotifications *notifications READ notifications WRITE setNotifications NOTIFY notificationsChanged);
 
   Q_PROPERTY(QRectF renderArea READ renderArea NOTIFY renderAreaChanged);
   Q_PROPERTY(QSizeF videoResolution READ videoResolution NOTIFY videoResolutionChanged);
@@ -119,8 +119,8 @@ public:
   QString imageSuffix() const;
   QString videoSuffix() const;
 
-  Notifications *notifications() const;
-  void setNotifications(Notifications *notifications);
+  DeclarativeQtCameraNotifications *notifications() const;
+  void setNotifications(DeclarativeQtCameraNotifications *notifications);
 
   Zoom *zoom() const;
   Flash *flash() const;
index 3be0a33..65e3e7e 100644 (file)
@@ -17,7 +17,7 @@ HEADERS += plugin.h previewprovider.h camera.h mode.h imagemode.h videomode.h \
            colortone.h exposure.h aperture.h iso.h noisereduction.h \
            flickerreduction.h videomute.h metadata.h imagesettings.h \
            imageresolutionmodel.h videosettings.h videoresolutionmodel.h \
-           notifications.h notificationscontainer.h sounds.h focus.h autofocus.h \
+           notificationscontainer.h sounds.h focus.h autofocus.h \
            roi.h
 
 SOURCES += plugin.cpp previewprovider.cpp camera.cpp mode.cpp imagemode.cpp videomode.cpp \
@@ -25,5 +25,7 @@ SOURCES += plugin.cpp previewprovider.cpp camera.cpp mode.cpp imagemode.cpp vide
            colortone.cpp exposure.cpp aperture.cpp iso.cpp noisereduction.cpp \
            flickerreduction.cpp videomute.cpp metadata.cpp imagesettings.cpp \
            imageresolutionmodel.cpp videosettings.cpp videoresolutionmodel.cpp \
-           notifications.cpp notificationscontainer.cpp sounds.cpp focus.cpp autofocus.cpp \
+           notificationscontainer.cpp sounds.cpp focus.cpp autofocus.cpp \
            roi.cpp
+
+HEADERS += declarativeqtcameranotifications.h
similarity index 74%
rename from declarative/notifications.h
rename to declarative/declarativeqtcameranotifications.h
index 071c5df..9ba74a4 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef NOTIFICATIONS_H
-#define NOTIFICATIONS_H
+#ifndef DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H
+#define DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H
 
 #include <QObject>
 
-class Notifications {
+class DeclarativeQtCameraNotifications {
 public:
-  Notifications();
-  virtual ~Notifications();
+  DeclarativeQtCameraNotifications() {}
+  virtual ~DeclarativeQtCameraNotifications() {}
 
   virtual void imageCaptureStarted() = 0;
   virtual void imageCaptureEnded() = 0;
@@ -36,6 +36,6 @@ public:
   virtual void videoRecordingEnded() = 0;
   virtual void autoFocusAcquired() = 0;
 };
-Q_DECLARE_INTERFACE(Notifications, "org.foolab.qml.CameraPlus/1.0");
+Q_DECLARE_INTERFACE(DeclarativeQtCameraNotifications, "org.foolab.qml.CameraPlus.Notifications/1.0");
 
-#endif /* NOTIFICATIONS_H */
+#endif /* DECLARATIVE_QT_CAMERA_NOTIFICATIONS_H */
diff --git a/declarative/notifications.cpp b/declarative/notifications.cpp
deleted file mode 100644 (file)
index b1a17cd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*!
- * This file is part of CameraPlus.
- *
- * Copyright (C) 2012 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "notifications.h"
-
-Notifications::Notifications() {
-
-}
-
-Notifications::~Notifications() {
-
-}
index 309baff..bef3461 100644 (file)
@@ -21,7 +21,7 @@
 #include "notificationscontainer.h"
 #include "qtcamdevice.h"
 #include "qtcamnotifications.h"
-#include "notifications.h"
+#include "declarativeqtcameranotifications.h"
 
 NotificationsContainer::NotificationsContainer(QObject *parent) :
   QObject(parent), m_dev(0), m_notifications(0) {
@@ -62,11 +62,11 @@ void NotificationsContainer::setDevice(QtCamDevice *dev) {
   }
 }
 
-Notifications *NotificationsContainer::notifications() const {
+DeclarativeQtCameraNotifications *NotificationsContainer::notifications() const {
   return m_notifications;
 }
 
-bool NotificationsContainer::setNotifications(Notifications *notifications) {
+bool NotificationsContainer::setNotifications(DeclarativeQtCameraNotifications *notifications) {
   QMutexLocker lock(&m_mutex);
 
   if (m_notifications != notifications) {
index b6adda3..18c7a14 100644 (file)
@@ -28,7 +28,7 @@
 #include <QMutex>
 
 class QtCamDevice;
-class Notifications;
+class DeclarativeQtCameraNotifications;
 
 class NotificationsContainer : public QObject {
   Q_OBJECT
@@ -38,8 +38,8 @@ public:
   ~NotificationsContainer();
 
   void setDevice(QtCamDevice *dev);
-  Notifications *notifications() const;
-  bool setNotifications(Notifications *notifications);
+  DeclarativeQtCameraNotifications *notifications() const;
+  bool setNotifications(DeclarativeQtCameraNotifications *notifications);
 
 private slots:
   void imageCaptureStarted();
@@ -50,7 +50,7 @@ private slots:
 
 private:
   QPointer<QtCamDevice> m_dev;
-  Notifications *m_notifications;
+  DeclarativeQtCameraNotifications *m_notifications;
   QMutex m_mutex;
 };
 
index c2e9966..aeec702 100644 (file)
@@ -44,7 +44,7 @@
 #include "imageresolutionmodel.h"
 #include "videosettings.h"
 #include "videoresolutionmodel.h"
-#include "notifications.h"
+#include "declarativeqtcameranotifications.h"
 #include "sounds.h"
 
 #include <QtDeclarative>
@@ -95,7 +95,7 @@ void Plugin::registerTypes(const char *uri) {
   qmlRegisterType<ImageSettings>(uri, MAJOR, MINOR, "ImageSettings");
   qmlRegisterType<VideoSettings>(uri, MAJOR, MINOR, "VideoSettings");
   qmlRegisterType<Sounds>(uri, MAJOR, MINOR, "Sounds");
-  qmlRegisterInterface<Notifications>("Notifications");
+  qmlRegisterInterface<DeclarativeQtCameraNotifications>("DeclarativeQtCameraNotifications");
 
   qmlRegisterUncreatableType<ImageResolutionModel>(uri, MAJOR, MINOR, "ImageResolutionModel",
                          "ImageResolutionModel can be obtained from ImageSettings");
index f6016b3..27dbae3 100644 (file)
 #define SOUNDS_H
 
 #include <QObject>
-#include "notifications.h"
+#include "declarativeqtcameranotifications.h"
 #include <canberra.h>
 
 class QtCamConfig;
 class QDBusServiceWatcher;
 
-class Sounds : public QObject, public Notifications {
+class Sounds : public QObject, public DeclarativeQtCameraNotifications {
   Q_OBJECT
-  Q_INTERFACES(Notifications);
+  Q_INTERFACES(DeclarativeQtCameraNotifications);
 
   Q_PROPERTY(bool mute READ isMuted WRITE setMuted NOTIFY muteChanged);