Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Clipboard::set_text #2078

Merged
merged 2 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/re_viewer/src/misc/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fn start_puffin_viewer() {

if let Err(err) = child {
let cmd = format!("cargo install puffin_viewer && puffin_viewer --url {url}",);
re_viewer_context::Clipboard::with(|clipboard| clipboard.set_text(cmd.clone()));
re_log::warn!("Failed to start puffin_viewer: {err}. Try connecting manually with: {cmd}");

rfd::MessageDialog::new()
Expand Down
11 changes: 0 additions & 11 deletions crates/re_viewer_context/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ impl Clipboard {
}
}

#[cfg(not(target_arch = "wasm32"))] // only used sometimes
pub fn set_text(&mut self, text: String) {
if let Some(clipboard) = &mut self.arboard {
if let Err(err) = clipboard.set_text(text) {
re_log::error!("Failed to copy text to clipboard: {err}",);
} else {
re_log::info!("Text copied to clipboard");
}
}
}

pub fn set_image(&mut self, size: [usize; 2], rgba_unmultiplied: &[u8]) {
let [width, height] = size;
assert_eq!(width * height * 4, rgba_unmultiplied.len());
Expand Down