This file is indexed.

/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/mediacenter/elements/playlist/Playlist.qml is in plasma-mediacenter 5.7.3-1.

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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/***************************************************************************
 *   Copyright 2012 Sinny Kumari <ksinny@gmail.com>                        *
 *                                                                         *
 *   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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   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, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 ***************************************************************************/

import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.mediacenter 2.0 as MediaCenterElements

FocusScope {
    id: playlistItem
    property bool active: false
    signal playRequested(string url)

    PlasmaCore.FrameSvgItem {
        imagePath: "widgets/background"
        enabledBorders: "LeftBorder|TopBorder|BottomBorder"
        anchors.fill: parent

        Item {
            anchors { fill: parent; leftMargin: 10; topMargin: 10; bottomMargin: 10 }
            clip: true

            MultiplePlaylists {
                id: multiplePlaylists
                anchors { top: parent.top; left: parent.left; right: parent.right }
                height: 64

                onNeedsFocus: multiplePlaylists.focus = true
                onGiveUpFocus: filterText.focus = true
                Keys.onDownPressed: filterText.focus = true
            }

            Row {
                id: playlistActions
                anchors { top: multiplePlaylists.bottom; left: parent.left; right: parent.right }
                height: 64

                PlasmaComponents.TextField {
                    id: filterText
                    width: parent.width * 4/5
                    height: 30
                    anchors.verticalCenter: parent.verticalCenter
                    clearButtonShown: true
                    placeholderText: i18n("Search Playlist")
                    focus: true
                    Keys.onDownPressed: playlistList.focus = true;
                    Keys.onUpPressed: multiplePlaylists.focus = true
                }

                Item {
                    height: parent.height
                    width: parent.width - filterText.width - clearPlaylist.width - randomButton.width
                    Text {
                        id: mediaCount
                        anchors.verticalCenter: parent.verticalCenter
                        text: (playlist.count !== undefined) ? i18np("%1 item", "%1 items", playlistList.count) : ""
                        font.pixelSize: 18
                        color: theme.textColor
                    }
                }

                PlasmaComponents.ToolButton {
                    id: randomButton
                    width: height
                    height: parent.height
                    iconSource: "media-playlist-shuffle"
                    onClicked: {
                       pmcInterfaceInstance.playlistModel.shuffle();
                       playlistList.currentIndex = 0;
                    }
                }

                PlasmaComponents.ToolButton {
                    id: clearPlaylist
                    width: height
                    height: parent.height
                    iconSource: "edit-clear-list"
                    onClicked: pmcInterfaceInstance.playlistModel.clearPlaylist()
                }
            }

            MediaCenterElements.FilterPlaylistModel {
                id: filterModel
                sourcePlaylistModel : pmcInterfaceInstance.playlistModel
                filterString: filterText.text
            }

            ListView {
                id: playlistList
                property string currentlyPlayingUrl: pmcInterfaceInstance.playlistModel.currentUrl

                anchors { top: playlistActions.bottom; left: parent.left; right: parent.right }
                anchors.bottom: parent.bottom
                anchors.margins: 5

                model: filterModel
                spacing: 3
                clip: true
                delegate: PlaylistDelegate {
                    width: playlistList.width - playlistScrollbar.width ; height: 32
                    onPlayRequested: {
                        playlistList.currentIndex = index;
                        filterModel.playFromSourceModel(index);
                        playlistList.positionViewAtIndex(pmcInterfaceInstance.playlistModel.currentIndex, ListView.Contain);
                    }
                    onRemoveRequested: {
                        filterModel.removeFromSourceModel(indexToRemove)
                    }
                }

                PlasmaComponents.ScrollBar {
                    id: playlistScrollbar
                    orientation: Qt.Vertical
                    flickableItem: playlistList
                }

                Timer {
                    id: positionViewAtIndexTimer
                    interval: 10
                    onTriggered: if (!playlistList.moving) {
                        playlistList.positionViewAtIndex(playlistList.currentIndex, ListView.Contain);
                    }
                }

                onCurrentIndexChanged: {
                    if (currentIndex < count) {
                        positionViewAtIndexTimer.restart();
                    }
                }

                onCurrentlyPlayingUrlChanged: playCurrent()

                Keys.onPressed: if (event.key == Qt.Key_Up && currentIndex == 0) {
                    filterText.focus = true;
                    event.accepted = true;
                } else if (event.key != Qt.Key_Escape && event.text && filterText.visible) {
                    filterText.focus = true;
                    filterText.text = event.text;
                } else if (event.key == Qt.Key_Escape && currentIndex) {
                    currentIndex = 0;
                    event.accepted = true;
                }

                function playCurrent()
                {
                    if (pmcInterfaceInstance.playlistModel.currentUrl) {
                        playlistItem.active = true;
                        playlistItem.playRequested(pmcInterfaceInstance.playlistModel.currentUrl);
                        filterText.text = "";
                    }
                }
            }
        }
    }

    function playNext()
    {
        pmcInterfaceInstance.playlistModel.playNext();
    }

    function playPrevious()
    {
        pmcInterfaceInstance.playlistModel.playPrevious();
    }

    function playTheCurrentInList()
    {
        if (pmcInterfaceInstance.playlistModel.currentIndex != -1) {
            playlistList.playCurrent();
        }
    }

    function playAll()
    {
        if (mediaBrowserInstance) {
            pmcInterfaceInstance.playlistModel.switchToDefaultPlaylist();
            pmcInterfaceInstance.playlistModel.clearPlaylist();
            pmcInterfaceInstance.playlistModel.addAllToPlaylist(mediaBrowserInstance.currentBrowsingBackend.allMedia());
        }
    }

    Component.onCompleted: playTheCurrentInList();
}