Corrected video recording resolution for front camera
[harmattan/cameraplus] / src / trackerstore.cpp
index 604627d..a0f73e2 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
 #include <QSparqlConnection>
 #include <QSparqlQuery>
 #include <QUrl>
+#if defined(QT4)
 #include <QDeclarativeInfo>
+#elif defined(QT5)
+#include <QQmlInfo>
+#endif
 #include <QSparqlResult>
 #include <QScopedPointer>
 #include <QSparqlError>
@@ -58,7 +62,13 @@ void TrackerStore::setActive(bool active) {
     return;
   }
 
-  m_connection = new QSparqlConnection("QTRACKER_DIRECT", QSparqlConnectionOptions(), this);
+  if (active) {
+    m_connection = new QSparqlConnection("QTRACKER_DIRECT", QSparqlConnectionOptions(), this);
+  }
+  else {
+    m_connection->deleteLater();
+    m_connection = 0;
+  }
 
   emit activeChanged();
 }