Warning, /plasma/discover/libdiscover/backends/FlatpakBackend/qml/FlatpakRemoveData.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import org.kde.discover as Discover
0010 import org.kde.kirigami as Kirigami
0011 
0012 Kirigami.InlineMessage {
0013     id: root
0014 
0015     required property Discover.AbstractResource resource
0016 
0017     Layout.fillWidth: true
0018     text: i18nd("libdiscover", "%1 is not installed but it still has data present.", resource.name)
0019     visible: resource.hasData && query.count.number === 0
0020     height: visible ? implicitHeight : 0
0021 
0022     Discover.ResourcesProxyModel {
0023         id: query
0024         backendFilter: root.resource.backend
0025         resourcesUrl: root.resource.url
0026         stateFilter: Discover.AbstractResource.Installed
0027     }
0028 
0029     actions: [
0030         Kirigami.Action {
0031             icon.name: "delete"
0032             text: i18nd("libdiscover", "Delete settings and user data")
0033             onTriggered: {
0034                 enabled = false
0035                 root.text = i18nd("libdiscover", "Clearing settings and user data…")
0036                 root.resource.clearUserData()
0037             }
0038         }
0039     ]
0040 }