Skip to content
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
11 changes: 7 additions & 4 deletions src/mounter/gvfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ fn network_scan(uri: &str, sizes: IconSizes) -> Result<Vec<tab::Item>, String> {
Ok(items)
}

fn dir_info(uri: &str) -> Result<(String, String), glib::Error> {
fn dir_info(uri: &str) -> Result<(String, String, Option<PathBuf>), glib::Error> {
let (resolved_uri, file) = resolve_uri(uri);
let info = file.query_info(
gio::FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
gio::FileQueryInfoFlags::NONE,
gio::Cancellable::NONE,
)?;

Ok((resolved_uri, info.display_name().into()))
Ok((resolved_uri, info.display_name().into(), file.path()))
}

fn mount_op(uri: String, event_tx: mpsc::UnboundedSender<Event>) -> gio::MountOperation {
Expand Down Expand Up @@ -288,7 +288,10 @@ enum Cmd {
IconSizes,
mpsc::Sender<Result<Vec<tab::Item>, String>>,
),
DirInfo(String, mpsc::Sender<Result<(String, String), glib::Error>>),
DirInfo(
String,
mpsc::Sender<Result<(String, String, Option<PathBuf>), glib::Error>>,
),
Unmount(MounterItem),
}

Expand Down Expand Up @@ -651,7 +654,7 @@ impl Mounter for Gvfs {
items_rx.blocking_recv()
}

fn dir_info(&self, uri: &str) -> Option<(String, String)> {
fn dir_info(&self, uri: &str) -> Option<(String, String, Option<PathBuf>)> {
let (result_tx, mut result_rx) = mpsc::channel(1);
self.command_tx
.send(Cmd::DirInfo(uri.to_string(), result_tx))
Expand Down
2 changes: 1 addition & 1 deletion src/mounter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub trait Mounter: Send + Sync {
fn mount(&self, item: MounterItem) -> Task<()>;
fn network_drive(&self, uri: String) -> Task<()>;
fn network_scan(&self, uri: &str, sizes: IconSizes) -> Option<Result<Vec<tab::Item>, String>>;
fn dir_info(&self, uri: &str) -> Option<(String, String)>;
fn dir_info(&self, uri: &str) -> Option<(String, String, Option<PathBuf>)>;
fn unmount(&self, item: MounterItem) -> Task<()>;
fn subscription(&self) -> Subscription<MounterMessage>;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,11 +1362,11 @@ pub struct EditLocation {

impl EditLocation {
pub fn resolve(&self) -> Option<Location> {
if let Location::Network(uri, _, path) = &self.location {
if let Location::Network(uri, ..) = &self.location {
MOUNTERS
.values()
.find_map(|mounter| mounter.dir_info(uri))
.map(|(uri, display_name)| Location::Network(uri, display_name, path.clone()))
.map(|(uri, display_name, path_opt)| Location::Network(uri, display_name, path_opt))
} else {
let Some(selected) = self.selected else {
return Some(self.location.clone());
Expand Down
Loading