4 * This file is part of CameraPlus.
6 * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 import com.nokia.meego 1.1
29 // QML QtGallery stuff is crap.
30 // Most of the ideas (and some code) for loading and displaying images are stolen from
31 // N9QmlPhotoPicker https://github.com/petrumotrescu/N9QmlPhotoPicker
33 // TODO: this is really basic.
34 // TODO: Seems losing resources in post capture will not be recovered from.
39 controlsVisible: false
40 policyMode: CameraResources.PostCapture
60 startY: view.height / 2
61 PathLine { x: view.width * 2; y: view.height / 2 }
64 flickDeceleration: 999999 // Insanely high value to prevent panning multiple images
65 preferredHighlightBegin: 0.5
66 preferredHighlightEnd: 0.5
67 highlightRangeMode: PathView.StrictlyEnforceRange
70 model: SparqlListModel {
71 // This is the exact query used by Harmattan gallery.
72 // Gallery prints it as part of its debugging when
73 // passing -output-level debug ;-)
74 query: "SELECT nie:url(?urn) AS ?url nfo:fileName(?urn) AS ?filename ?created nie:mimeType(?urn) AS ?mimetype ( EXISTS { ?urn nao:hasTag nao:predefined-tag-favorite . } ) AS ?favorite nfo:duration(?urn) AS ?duration ?urn \"false\"^^xsd:boolean AS ?isVirtual nfo:fileLastModified(?urn) as ?lastmod nfo:hasRegionOfInterest(?urn) as ?roi tracker:id(?urn) AS ?trackerid WHERE { ?urn rdf:type nfo:Visual ; tracker:available \"true\"^^xsd:boolean . OPTIONAL { ?urn nie:contentCreated ?created } . ?urn nfo:equipment \"urn:equipment:" + deviceInfo.manufacturer + ":" + deviceInfo.model + ":\" . } ORDER BY DESC (?created)"
76 connection: SparqlConnection {
78 driver: "QTRACKER_DIRECT"
79 onStatusChanged: checkStatus(status)
81 function checkStatus(status) {
82 if (status == SparqlConnection.Error) {
83 console.log("Error = "+connection.errorString());
89 delegate: PostCaptureItem {
90 width: view.width - 10
98 anchors.bottom: parent.bottom
99 tools: ToolBarLayout {
101 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: { pageStack.pop(); } }
108 anchors.top: parent.top
109 height: toolBar.height
112 opacity: toolBar.opacity
113 visible: toolBar.visible