Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

CloudView.qml 1.68 KB
Newer Older
Camilo higuita's avatar
Camilo higuita committed
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
import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.mauikit 1.0 as Maui

import "../../view_models/BabeTable"

import CloudList 1.0
import BaseModel 1.0

BabeTable
{
    id: control

    headBarExit: false

    property alias list : _cloudList

    BaseModel
    {
        id: _cloudModel
        list: _cloudList
    }

    CloudList
    {
        id: _cloudList
        account: currentAccount
    }

    model: _cloudModel

    delegate: TableDelegate
    {
        id: delegate

        width: listView.width

        number :  false
        quickPlay: true
        coverArt : false
        trackDurationVisible : false
        trackRatingVisible : false
        menuItem: false
        remoteArtwork: false
        playingIndicator: false

        onPressAndHold: if(isMobile && allowMenu) openItemMenu(index)
        onRightClicked: if(allowMenu) openItemMenu(index)

        onClicked:
        {
            currentIndex = index
            if(selectionMode)
            {
                H.addToSelection(listView.model.get(listView.currentIndex))
                return
            }

            if(isMobile)
                rowClicked(index)

        }

        onDoubleClicked:
        {
            currentIndex = index
            if(!isMobile)
                rowClicked(index)
        }

        onPlay:
        {
            currentIndex = index
74
            if(Maui.FM.fileExists("file://" + _cloudList.get(index).thumbnail))
Camilo higuita's avatar
Camilo higuita committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
            {
                quickPlayTrack(index)
            }else
            {
                _cloudList.requestFile(index)
            }
        }

        onArtworkCoverClicked:
        {
            currentIndex = index
            goToAlbum()
        }
    }
}