[fractal/fractal-next] user: Expose user-id as property
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/fractal-next] user: Expose user-id as property
- Date: Wed, 5 May 2021 07:43:37 +0000 (UTC)
commit d2004f061838f91557f2fff454ee2b0c410853bf
Author: Julian Sparber <julian sparber net>
Date: Tue May 4 18:46:44 2021 +0200
user: Expose user-id as property
src/session/user.rs | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/session/user.rs b/src/session/user.rs
index 32660b47..41fa12db 100644
--- a/src/session/user.rs
+++ b/src/session/user.rs
@@ -93,6 +93,12 @@ impl User {
glib::Object::new(&[("user-id", &user_id.to_string())]).expect("Failed to create User")
}
+ pub fn user_id(&self) -> UserId {
+ use std::convert::TryFrom;
+ let priv_ = imp::User::from_instance(&self);
+ UserId::try_from(priv_.user_id.get().unwrap().as_str()).unwrap()
+ }
+
pub fn display_name(&self) -> String {
let priv_ = imp::User::from_instance(&self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]