diff --git a/Cargo.lock b/Cargo.lock index 93aa108..2b2273b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -731,7 +731,7 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" [[package]] name = "ripdrag" -version = "0.4.8" +version = "0.4.9" dependencies = [ "clap", "glib-macros 0.19.3", diff --git a/Cargo.toml b/Cargo.toml index 3640587..85ff7ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ripdrag" authors = ["Nicola Guerrera "] description = "Drag and Drop files to and from the terminal" -version = "0.4.8" +version = "0.4.9" readme = "README.md" repository = "https://github.com/nik012003/ripdrag" edition = "2021" diff --git a/src/list_view.rs b/src/list_view.rs index c2831bb..d90b0d3 100644 --- a/src/list_view.rs +++ b/src/list_view.rs @@ -1,5 +1,3 @@ -use std::collections::HashSet; - use glib_macros::clone; use gtk::gdk::*; use gtk::gio::{self, ListStore}; @@ -60,9 +58,10 @@ fn create_drag_source(row: &CenterBox, selection: &MultiSelection) -> DragSource // This will prevent the click to trigger, a drag should happen! me.set_state(gtk::EventSequenceState::Claimed); let selected = selection.selection(); - let mut files : HashSet = HashSet::with_capacity(selected.size() as usize); + let mut files : Vec = Vec::with_capacity(selected.size() as usize); + for index in 0..selected.size() { - files.insert(selection.item(selected.nth(index as u32)).unwrap().downcast::().unwrap().file().uri().to_string()); + files.push(selection.item(selected.nth(index as u32)).unwrap().downcast::().unwrap().file().uri().to_string()); } // Is the activated row also selected?