summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-08-17 13:17:16 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-08-18 00:44:22 +0800
commitce151940fa69355c357faea91bd01e8c94b2e64f (patch)
treeaf68abcb2b46569eaddd67481cd52169b2ddf6e8 /services
parent1078ef324f8e83a4390fcc5e565119dff9228c8c (diff)
clip: recognize more types
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 || "",