summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/Clip.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/Clip.qml b/services/Clip.qml
index 622b293..4b289a0 100644
--- a/services/Clip.qml
+++ b/services/Clip.qml
@@ -21,6 +21,17 @@ Searchable {
property var _clipMetadata: ({})
+ function getType(text: string): string {
+ if (!text)
+ return;
+ if (text.startsWith("http://") || text.startsWith("https://"))
+ return "web";
+ if (text.startsWith("file://"))
+ return "file";
+
+ return "text";
+ }
+
list: {
if (!_clipHist?.length)
return [];
@@ -50,7 +61,7 @@ Searchable {
return {
index: idNum,
- isImage: isImg,
+ type: isImg ? "image" : root.getType(payload),
data: isImg ? imgPath : payload,
raw: raw,
timestamp: metadata.timestamp || "",