Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Credentials::get_unix_user returns user id #284

Merged
merged 4 commits into from
Mar 14, 2020
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ gobject-sys = { git = "https://github.com/gtk-rs/sys" }

[dev-dependencies]
gir-format-check = "^0.1"
serial_test = "0.1"
serial_test_derive = "0.1"
serial_test = "0.4"
serial_test_derive = "0.4"
2 changes: 2 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ status = "generate"
[[object.function]]
name = "get_unix_user"
cfg_condition = "unix"
[object.function.return]
use_return_for_result = true
[[object.function]]
name = "set_unix_user"
cfg_condition = "unix"
Expand Down
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 2 files
+4 −4 Gtk-3.0.gir
+12 −0 fix.sh
6 changes: 3 additions & 3 deletions src/auto/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ impl Credentials {
}

#[cfg(any(unix, feature = "dox"))]
pub fn get_unix_user(&self) -> Result<(), glib::Error> {
pub fn get_unix_user(&self) -> Result<u32, glib::Error> {
sdroege marked this conversation as resolved.
Show resolved Hide resolved
unsafe {
let mut error = ptr::null_mut();
let _ = gio_sys::g_credentials_get_unix_user(self.to_glib_none().0, &mut error);
let ret = gio_sys::g_credentials_get_unix_user(self.to_glib_none().0, &mut error);
if error.is_null() {
Ok(())
Ok(ret)
} else {
Err(from_glib_full(error))
}
Expand Down
4 changes: 2 additions & 2 deletions src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 0a4cfc4)
from gir-files (https://github.com/gtk-rs/gir-files @ 22748fa)
Generated by gir (https://github.com/gtk-rs/gir @ 5467258)
from gir-files (https://github.com/gtk-rs/gir-files @ 480c117)
21 changes: 12 additions & 9 deletions src/subclass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>

pub mod application;
pub mod input_stream;
pub mod io_stream;
pub mod output_stream;
pub mod seekable;
mod application;
mod input_stream;
mod io_stream;
mod output_stream;
mod seekable;

pub use self::application::ArgumentList;
pub use self::prelude::*;

pub mod prelude {
pub use super::application::{ApplicationImpl, ArgumentList};
pub use super::input_stream::InputStreamImpl;
pub use super::io_stream::IOStreamImpl;
pub use super::output_stream::OutputStreamImpl;
pub use super::application::{ApplicationImpl, ApplicationImplExt};
pub use super::input_stream::{InputStreamImpl, InputStreamImplExt};
pub use super::io_stream::{IOStreamImpl, IOStreamImplExt};
pub use super::output_stream::{OutputStreamImpl, OutputStreamImplExt};
pub use super::seekable::SeekableImpl;
pub use glib::subclass::prelude::*;
}