MauiKit Controls

ShareDialog.qml
1import QtQuick 2.14
2
3import org.mauikit.controls 1.2 as Maui
4import org.mauikit.filebrowsing 1.0 as FB
5
6import "."
7
8/**
9 * @since org.mauikit.controls 1.0
10 * @brief A dialog listing the available services for sharing the given set of local files.
11*/
12Item
13{
14 id: control
15
16 /**
17 *
18 */
19 property var urls : []
20
21 /**
22 *
23 */
24 property string mimeType
25
26 Loader
27 {
28 id: _shareDialogLoader
29 // asynchronous: true
30 active: !Maui.Handy.isAndroid
31 source: "ShareDialogLinux.qml"
32 }
33
34 /**
35 *
36 */
37 function open()
38 {
39 if(Maui.Handy.isLinux)
40 {
41 console.log(control.urls)
42 _shareDialogLoader.item.urls = control.urls
43 _shareDialogLoader.item.mimeType = control.mimeType ? control.mimeType : FB.FM.getFileInfo(control.urls[0]).mime
44 _shareDialogLoader.item.open()
45 return;
46 }
47 }
48
49 /**
50 *
51 */
52 function close()
53 {
54 if(Maui.Handy.isLinux)
55 _shareDialogLoader.item.close()
56 }
57}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.