From 037ae394da308e7a22cae8f9c90939a9e746de49 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Mon, 27 Jan 2025 16:47:30 +0100 Subject: [PATCH] gio: Use manual `env: &[OsString]` parameter for SubprocessLauncher::set_environ --- gio/Gir.toml | 3 +++ gio/src/auto/subprocess_launcher.rs | 7 ------- gio/src/subprocess_launcher.rs | 10 +++++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gio/Gir.toml b/gio/Gir.toml index 0fcf3cc6044f..f26bd9864f26 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -1443,6 +1443,9 @@ status = "generate" [[object.function]] name = "close" cfg_condition = "unix" + [[object.function]] + name = "set_environ" + manual = true [[object]] name = "Gio.ThemedIcon" diff --git a/gio/src/auto/subprocess_launcher.rs b/gio/src/auto/subprocess_launcher.rs index 2855447c02ab..efccd793f7c1 100644 --- a/gio/src/auto/subprocess_launcher.rs +++ b/gio/src/auto/subprocess_launcher.rs @@ -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 { diff --git a/gio/src/subprocess_launcher.rs b/gio/src/subprocess_launcher.rs index f96d53b8b2d8..ba81437ba160 100644 --- a/gio/src/subprocess_launcher.rs +++ b/gio/src/subprocess_launcher.rs @@ -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)))] @@ -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")]