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: losing resources while playback won't show an error
38 controlsVisible: false
39 policyMode: CameraResources.PostCapture
41 standbyVisible: !Qt.application.active
43 property Item currentItem: null
45 function parseDate(str) {
46 var parts = str.split('T');
47 var dates = parts[0].split('-');
48 var times = parts[1].split(':');
49 return new Date(dates[0], dates[1], dates[2], times[0], times[1], times[2]);
63 startY: view.height / 2
64 PathLine { x: view.width * 2; y: view.height / 2 }
67 flickDeceleration: 999999 // Insanely high value to prevent panning multiple images
68 preferredHighlightBegin: 0.5
69 preferredHighlightEnd: 0.5
70 highlightRangeMode: PathView.StrictlyEnforceRange
73 model: SparqlListModel {
74 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)"
76 connection: SparqlConnection {
78 driver: "QTRACKER_DIRECT"
79 onStatusChanged: checkStatus(status)
81 function checkStatus(status) {
82 if (status == SparqlConnection.Error) {
84 console.log("Error = " + connection.errorString());
90 delegate: PostCaptureItem {
91 width: view.width - 10
99 anchors.bottom: parent.bottom
100 tools: ToolBarLayout {
102 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: { pageStack.pop(); } }
107 opacity: toolBar.opacity
108 anchors.top: parent.top
109 visible: toolBar.visible
111 tools: ToolBarLayout {
113 text: currentItem ? currentItem.itemTitle : ""
114 anchors.top: parent.top
115 anchors.bottom: parent.bottom
116 anchors.left: parent.left
118 verticalAlignment: Text.AlignVCenter
122 text: currentItem ? Qt.formatDateTime(parseDate(currentItem.creationDate)) : ""
124 anchors.top: parent.top
125 anchors.bottom: parent.bottom
126 anchors.right: parent.right
127 verticalAlignment: Text.AlignVCenter