This file is indexed.

/usr/share/unity8/Dash/Previews/PreviewImageGallery.qml is in unity8-common 8.12+16.04.20160401-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * Copyright (C) 2014 Canonical, Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import QtQuick 2.4
import Ubuntu.Components 1.3
import "../../Components"

/*! This preview widget shows a horizontal list of images.
 *  The URIs for the images should be an array in widgetData["sources"].
 *  Images fall back to widgetData["fallback"] if loading fails
 */

PreviewWidget {
    id: root
    implicitHeight: units.gu(22)

    property Item rootItem: QuickUtils.rootItem(root)

    ListView {
        id: previewImageListView
        objectName: "previewImageListView"
        spacing: units.gu(1)
        anchors.fill: parent
        orientation: ListView.Horizontal
        cacheBuffer: width * 3
        model: root.widgetData["sources"]
        clip: true

        onCurrentIndexChanged: overlay.updateInitialItem()

        LazyImage {
            objectName: "placeholderScreenshot"
            anchors {
                top: parent.top
                bottom: parent.bottom
            }
            scaleTo: "height"
            source: "broken_image"
            initialWidth: units.gu(13)
            visible: previewImageListView.count == 0
        }

        delegate: LazyImage {
            objectName: "previewImage" + index
            anchors {
                top: parent.top
                bottom: parent.bottom
            }
            source: modelData || root.widgetData["fallback"] || ""
            scaleTo: "height"
            initialWidth: units.gu(13)
            pressed: mouseArea.pressed

            MouseArea {
                id: mouseArea
                anchors.fill: parent
                onClicked: {
                    previewImageListView.currentIndex = index;
                    overlay.updateInitialItem();
                    overlay.show();
                }
            }

            Connections {
                target: sourceImage
                // If modelData would change after failing to load it would not be
                // reloaded since the source binding is destroyed by the source = fallback
                // But at the moment the model never changes
                onStatusChanged: if (sourceImage.status === Image.Error) sourceImage.source = widgetData["fallback"];
            }
        }
    }

    PreviewOverlay {
        id: overlay
        objectName: "overlay"
        parent: rootItem
        anchors.fill: parent

        function updateInitialItem() {
            initialX = rootItem.mapFromItem(previewImageListView.currentItem, 0, 0).x;
            initialY = rootItem.mapFromItem(previewImageListView.currentItem, 0, 0).y;
            initialWidth = previewImageListView.currentItem.width;
            initialHeight = previewImageListView.currentItem.height;
        }

        delegate: ListView {
            id: overlayListView
            objectName: "overlayListView"
            anchors.fill: parent
            orientation: ListView.Horizontal
            highlightRangeMode: ListView.StrictlyEnforceRange
            highlightMoveDuration: 0
            snapMode: ListView.SnapOneItem
            boundsBehavior: Flickable.DragAndOvershootBounds
            model: root.widgetData["sources"]
            currentIndex: previewImageListView.currentIndex

            onCurrentIndexChanged: {
                // if the index changed while overlay is visible, it was from user interaction,
                // let's update the index of the original listview
                if (overlay.visible) {
                    previewImageListView.highlightMoveDuration = 0;
                    previewImageListView.highlightResizeDuration = 0;
                    previewImageListView.currentIndex = currentIndex;
                    previewImageListView.highlightMoveDuration = -1;
                    previewImageListView.highlightResizeDuration = -1;
                }
            }

            delegate: Image {
                id: screenshot
                anchors {
                    top: parent.top
                    bottom: parent.bottom
                }
                width: overlay.width
                source: modelData || root.widgetData["fallback"] || ""
                fillMode: Image.PreserveAspectFit
                sourceSize { width: screenshot.width; height: screenshot.height }

                // If modelData would change after failing to load it would not be
                // reloaded since the source binding is destroyed by the source = fallback
                // But at the moment the model never changes
                onStatusChanged: if (status === Image.Error) source = widgetData["fallback"];
            }

            MouseArea {
                anchors.fill: parent
                onClicked: overlay.headerShown = !overlay.headerShown
            }
        }
    }
}