Skip to content

Commit

Permalink
gio: Use manual env: &[OsString] parameter for SubprocessLauncher::…
Browse files Browse the repository at this point in the history
…set_environ
  • Loading branch information
pjungkamp committed Jan 29, 2025
1 parent 35e15b7 commit 037ae39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions gio/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,9 @@ status = "generate"
[[object.function]]
name = "close"
cfg_condition = "unix"
[[object.function]]
name = "set_environ"
manual = true

[[object]]
name = "Gio.ThemedIcon"
Expand Down
7 changes: 0 additions & 7 deletions gio/src/auto/subprocess_launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ impl SubprocessLauncher {
}
}

#[doc(alias = "g_subprocess_launcher_set_environ")]
pub fn set_environ(&self, env: &[&std::path::Path]) {
unsafe {
ffi::g_subprocess_launcher_set_environ(self.to_glib_none().0, env.to_glib_none().0);
}
}

#[doc(alias = "g_subprocess_launcher_set_flags")]
pub fn set_flags(&self, flags: SubprocessFlags) {
unsafe {
Expand Down
10 changes: 7 additions & 3 deletions gio/src/subprocess_launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
#[cfg(any(unix, all(docsrs, unix)))]
use std::os::unix::io::IntoRawFd;

#[cfg(unix)]
use glib::translate::*;

#[cfg(unix)]
use crate::ffi;

use crate::SubprocessLauncher;

#[cfg(all(docsrs, not(unix)))]
Expand All @@ -19,6 +16,13 @@ pub trait IntoRawFd: Sized {
}

impl SubprocessLauncher {
#[doc(alias = "g_subprocess_launcher_set_environ")]
pub fn set_environ(&self, env: &[std::ffi::OsString]) {
unsafe {
ffi::g_subprocess_launcher_set_environ(self.to_glib_none().0, env.to_glib_none().0);
}
}

#[cfg(unix)]
#[cfg_attr(docsrs, doc(cfg(unix)))]
#[doc(alias = "g_subprocess_launcher_take_fd")]
Expand Down

0 comments on commit 037ae39

Please sign in to comment.