mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
better clipboard handeling with new crate
This commit is contained in:
parent
2446f7320f
commit
16fef86753
1 changed files with 0 additions and 12 deletions
|
@ -50,13 +50,10 @@ pub fn setup(app_handle: tauri::AppHandle) {
|
||||||
if is_format_avail(formats::Bitmap.into()) {
|
if is_format_avail(formats::Bitmap.into()) {
|
||||||
match get_clipboard(formats::Bitmap) {
|
match get_clipboard(formats::Bitmap) {
|
||||||
Ok(image) => {
|
Ok(image) => {
|
||||||
println!("Image found in clipboard");
|
|
||||||
rt.block_on(async {
|
rt.block_on(async {
|
||||||
let base64_image = STANDARD.encode(&image);
|
let base64_image = STANDARD.encode(&image);
|
||||||
println!("Image encoded to base64");
|
|
||||||
insert_content_if_not_exists(&pool, "image", base64_image)
|
insert_content_if_not_exists(&pool, "image", base64_image)
|
||||||
.await;
|
.await;
|
||||||
println!("Image inserted into database");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -66,15 +63,6 @@ pub fn setup(app_handle: tauri::AppHandle) {
|
||||||
} else {
|
} else {
|
||||||
println!("No image format available in clipboard");
|
println!("No image format available in clipboard");
|
||||||
}
|
}
|
||||||
|
|
||||||
match get_clipboard(formats::RawData(0)) {
|
|
||||||
Ok(data) => {
|
|
||||||
println!("{:?}", data);
|
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
println!("Error reading raw data from clipboard: {:?}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue