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: Seems losing resources in post capture will not be recovered from.
38 controlsVisible: false
39 policyMode: CameraResources.PostCapture
42 property Item currentItem: null
44 function parseDate(str) {
45 var parts = str.split('T');
46 var dates = parts[0].split('-');
47 var times = parts[1].split(':');
48 return new Date(dates[0], dates[1], dates[2], times[0], times[1], times[2]);
62 startY: view.height / 2
63 PathLine { x: view.width * 2; y: view.height / 2 }
66 flickDeceleration: 999999 // Insanely high value to prevent panning multiple images
67 preferredHighlightBegin: 0.5
68 preferredHighlightEnd: 0.5
69 highlightRangeMode: PathView.StrictlyEnforceRange
72 model: SparqlListModel {
73 query: "SELECT nie:url(?urn) AS ?url nie:title(?urn) AS ?title nfo:fileName(?urn) AS ?filename ?created nie:mimeType(?urn) AS ?mimetype ( EXISTS { ?urn nao:hasTag nao:predefined-tag-favorite . } ) AS ?favorite nfo:fileLastModified(?urn) as ?lastmod 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)"
75 connection: SparqlConnection {
77 driver: "QTRACKER_DIRECT"
78 onStatusChanged: checkStatus(status)
80 function checkStatus(status) {
81 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(); } }
106 opacity: toolBar.opacity
107 anchors.top: parent.top
108 visible: toolBar.visible
110 tools: ToolBarLayout {
112 text: currentItem ? currentItem.itemTitle : ""
113 anchors.top: parent.top
114 anchors.bottom: parent.bottom
115 anchors.left: parent.left
117 verticalAlignment: Text.AlignVCenter
121 text: currentItem ? Qt.formatDateTime(parseDate(currentItem.creationDate)) : ""
123 anchors.top: parent.top
124 anchors.bottom: parent.bottom
125 anchors.right: parent.right
126 verticalAlignment: Text.AlignVCenter