mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
update const name, add comment
This commit is contained in:
parent
f4cef86438
commit
9e12cc9044
@ -9,20 +9,21 @@ glib::wrapper! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C-type property `value` conversion for `Item`
|
// C-type property `value` conversion for `Item`
|
||||||
const CREATE_NEW_AUTH: i64 = 0;
|
// * values > 0 reserved for `profile_identity_gemini_id`
|
||||||
const REMOVE_CURRENT_AUTH: i64 = -1;
|
const G_VALUE_CREATE_NEW_AUTH: i64 = 0;
|
||||||
|
const G_VALUE_REMOVE_CURRENT_AUTH: i64 = -1;
|
||||||
|
|
||||||
impl Item {
|
impl Item {
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
/// Create new `GObject` with formatted properties
|
/// Create new `GObject`
|
||||||
pub fn new(value: Value, title: &str, subtitle: &str) -> Self {
|
pub fn new(value: Value, title: &str, subtitle: &str) -> Self {
|
||||||
Object::builder()
|
Object::builder()
|
||||||
.property(
|
.property(
|
||||||
"value",
|
"value",
|
||||||
match value {
|
match value {
|
||||||
Value::CREATE_NEW_AUTH => CREATE_NEW_AUTH,
|
Value::CREATE_NEW_AUTH => G_VALUE_CREATE_NEW_AUTH,
|
||||||
Value::REMOVE_CURRENT_AUTH => REMOVE_CURRENT_AUTH,
|
Value::REMOVE_CURRENT_AUTH => G_VALUE_REMOVE_CURRENT_AUTH,
|
||||||
Value::PROFILE_IDENTITY_GEMINI_ID(value) => value,
|
Value::PROFILE_IDENTITY_GEMINI_ID(value) => value,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -36,8 +37,8 @@ impl Item {
|
|||||||
/// Get `value` as enum `Value`
|
/// Get `value` as enum `Value`
|
||||||
pub fn value_enum(&self) -> Value {
|
pub fn value_enum(&self) -> Value {
|
||||||
match self.value() {
|
match self.value() {
|
||||||
CREATE_NEW_AUTH => Value::CREATE_NEW_AUTH,
|
G_VALUE_CREATE_NEW_AUTH => Value::CREATE_NEW_AUTH,
|
||||||
REMOVE_CURRENT_AUTH => Value::REMOVE_CURRENT_AUTH,
|
G_VALUE_REMOVE_CURRENT_AUTH => Value::REMOVE_CURRENT_AUTH,
|
||||||
value => Value::PROFILE_IDENTITY_GEMINI_ID(value),
|
value => Value::PROFILE_IDENTITY_GEMINI_ID(value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user