Hide video torch setting when front camera is active
[harmattan/cameraplus] / declarative / videosettings.cpp
index cc06728..ec29a7a 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
@@ -79,6 +79,7 @@ void VideoSettings::deviceChanged() {
   delete m_resolutions;
   m_resolutions = 0;
 
+  emit aspectRatioCountChanged();
   emit resolutionsChanged();
 }
 
@@ -87,7 +88,6 @@ VideoResolutionModel *VideoSettings::resolutions() {
     return 0;
   }
 
-
   if (!m_resolutions) {
     m_resolutions = new VideoResolutionModel(m_settings, this);
   }
@@ -96,7 +96,7 @@ VideoResolutionModel *VideoSettings::resolutions() {
 }
 
 bool VideoSettings::isReady() const {
-  return m_settings;
+  return m_settings != 0;
 }
 
 bool VideoSettings::setResolution(const QString& aspectRatio, const QString& resolution) {
@@ -114,3 +114,7 @@ bool VideoSettings::setResolution(const QString& aspectRatio, const QString& res
 
   return false;
 }
+
+int VideoSettings::aspectRatioCount() const {
+  return aspectRatios().count();
+}