import com.nokia.extras 1.1
import QtCamera 1.0
import CameraPlus 1.0
-import QtMobility.systeminfo 1.2 as Qtm
import QtMobility.location 1.2
// TODO: flash not ready (battery low or flash not ready message)
camera: cam
}
- Qtm.DeviceInfo {
+ DeviceInfo {
id: deviceInfo
}
--- /dev/null
+/*!
+ * 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 "deviceinfo.h"
+#include <QSystemDeviceInfo>
+
+DeviceInfo::DeviceInfo(QObject *parent) :
+ QObject(parent),
+ m_info(new QtMobility::QSystemDeviceInfo(this)) {
+
+}
+
+DeviceInfo::~DeviceInfo() {
+
+}
+
+QString DeviceInfo::manufacturer() {
+ if (m_manufacturer.isEmpty()) {
+ m_manufacturer = m_info->manufacturer();
+ }
+
+ return m_manufacturer;
+}
+
+QString DeviceInfo::model() {
+ if (m_model.isEmpty()) {
+ m_model = m_info->model();
+ }
+
+ return m_model;
+}
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * 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
+ */
+
+#ifndef DEVICE_INFO_H
+#define DEVICE_INFO_H
+
+#include <QObject>
+
+namespace QtMobility {
+class QSystemDeviceInfo;
+};
+
+class DeviceInfo : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString manufacturer READ manufacturer CONSTANT);
+ Q_PROPERTY(QString model READ model CONSTANT);
+
+public:
+ DeviceInfo(QObject *parent = 0);
+ ~DeviceInfo();
+
+ QString manufacturer();
+ QString model();
+
+private:
+ QtMobility::QSystemDeviceInfo *m_info;
+
+ QString m_manufacturer;
+ QString m_model;
+};
+
+#endif /* DEVICE_INFO_H */
#include "postcapturemodel.h"
#include "batteryinfo.h"
#include "gridlines.h"
+#include "deviceinfo.h"
static void initQuill() {
// TODO: All these are hardcoded.
qmlRegisterType<PostCaptureModel>("CameraPlus", 1, 0, "PostCaptureModel");
qmlRegisterType<BatteryInfo>("CameraPlus", 1, 0, "BatteryInfo");
qmlRegisterType<GridLines>("CameraPlus", 1, 0, "GridLines");
+ qmlRegisterType<DeviceInfo>("CameraPlus", 1, 0, "DeviceInfo");
view.setSource(QUrl("qrc:/qml/main.qml"));
CONFIG += link_pkgconfig debug static mobility qtsparql galleryinterface-maemo-meegotouch \
shareuiinterface-maemo-meegotouch
-MOBILITY += location
+MOBILITY += location systeminfo
PKGCONFIG = gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-tag-0.10 \
gstreamer-pbutils-0.10 meego-gstreamer-interfaces-0.10 quill qmsystem2 libresourceqt1
SOURCES += main.cpp settings.cpp filenaming.cpp quillitem.cpp displaystate.cpp fsmonitor.cpp \
cameraresources.cpp compass.cpp orientation.cpp geocode.cpp mountprotector.cpp \
trackerstore.cpp focusrectangle.cpp sharehelper.cpp deletehelper.cpp galleryhelper.cpp \
- postcapturemodel.cpp batteryinfo.cpp gridlines.cpp
+ postcapturemodel.cpp batteryinfo.cpp gridlines.cpp deviceinfo.cpp
HEADERS += settings.h filenaming.h quillitem.h displaystate.h fsmonitor.h \
cameraresources.h compass.h orientation.h geocode.h mountprotector.h \
trackerstore.h focusrectangle.h sharehelper.h deletehelper.h galleryhelper.h \
- postcapturemodel.h batteryinfo.h gridlines.h
+ postcapturemodel.h batteryinfo.h gridlines.h deviceinfo.h
RESOURCES += ../qml/qml.qrc