Added support for strftime() format to creator name text
[harmattan/cameraplus] / lib / qtcamimagesettings.cpp
index 1f95296..3bf1a08 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
@@ -20,6 +20,7 @@
 
 #include "qtcamimagesettings.h"
 #include <QSharedData>
+#include <QDebug>
 
 class QtCamImageResolutionPrivate : public QSharedData {
 public:
@@ -155,6 +156,12 @@ QString QtCamImageSettings::profilePath() const {
 }
 
 QtCamImageResolution QtCamImageSettings::defaultResolution(const QString& aspectRatio) const {
+  if (d_ptr->resolutions.isEmpty()) {
+    return QtCamImageResolution(QString(), QString(),
+                               QSize(), QSize(), QSize(),
+                               -1, -1, -1, QString());
+  }
+
   if (aspectRatio.isEmpty()) {
     return d_ptr->resolutions[0];
   }
@@ -181,7 +188,7 @@ QList<QtCamImageResolution> QtCamImageSettings::resolutions(const QString& aspec
     }
   }
 
-  return d_ptr->resolutions;
+  return res;
 }
 
 QStringList QtCamImageSettings::aspectRatios() const {