mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-29 16:49:10 +08:00
Merge pull request #3438 from fufesou/fix/config_default_key_err
default config filed
This commit is contained in:
commit
846948985d
5
libs/hbb_common/examples/config.rs
Normal file
5
libs/hbb_common/examples/config.rs
Normal file
@ -0,0 +1,5 @@
|
||||
extern crate hbb_common;
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", hbb_common::config::PeerConfig::load("455058072"));
|
||||
}
|
@ -110,10 +110,10 @@ macro_rules! serde_field_string {
|
||||
}
|
||||
|
||||
macro_rules! serde_field_bool {
|
||||
($struct_name: ident, $field_name: literal, $func: ident) => {
|
||||
($struct_name: ident, $field_name: literal, $func: ident, $default: literal) => {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct $struct_name {
|
||||
#[serde(rename = $field_name)]
|
||||
#[serde(default = $default, rename = $field_name)]
|
||||
pub v: bool,
|
||||
}
|
||||
impl Default for $struct_name {
|
||||
@ -1037,32 +1037,37 @@ impl PeerConfig {
|
||||
serde_field_bool!(
|
||||
ShowRemoteCursor,
|
||||
"show_remote_cursor",
|
||||
default_show_remote_cursor
|
||||
default_show_remote_cursor,
|
||||
"ShowRemoteCursor::default_show_remote_cursor"
|
||||
);
|
||||
serde_field_bool!(
|
||||
ShowQualityMonitor,
|
||||
"show_quality_monitor",
|
||||
default_show_quality_monitor
|
||||
default_show_quality_monitor,
|
||||
"ShowQualityMonitor::default_show_quality_monitor"
|
||||
);
|
||||
serde_field_bool!(DisableAudio, "disable_audio", default_disable_audio);
|
||||
serde_field_bool!(DisableAudio, "disable_audio", default_disable_audio, "DisableAudio::default_disable_audio");
|
||||
serde_field_bool!(
|
||||
EnableFileTransfer,
|
||||
"enable_file_transfer",
|
||||
default_enable_file_transfer
|
||||
default_enable_file_transfer,
|
||||
"EnableFileTransfer::default_enable_file_transfer"
|
||||
);
|
||||
serde_field_bool!(
|
||||
DisableClipboard,
|
||||
"disable_clipboard",
|
||||
default_disable_clipboard
|
||||
default_disable_clipboard,
|
||||
"DisableClipboard::default_disable_clipboard"
|
||||
);
|
||||
serde_field_bool!(
|
||||
LockAfterSessionEnd,
|
||||
"lock_after_session_end",
|
||||
default_lock_after_session_end
|
||||
default_lock_after_session_end,
|
||||
"LockAfterSessionEnd::default_lock_after_session_end"
|
||||
);
|
||||
serde_field_bool!(PrivacyMode, "privacy_mode", default_privacy_mode);
|
||||
serde_field_bool!(PrivacyMode, "privacy_mode", default_privacy_mode, "PrivacyMode::default_privacy_mode");
|
||||
|
||||
serde_field_bool!(AllowSwapKey, "allow_swap_key", default_swap_key);
|
||||
serde_field_bool!(AllowSwapKey, "allow_swap_key", default_allow_swap_key, "AllowSwapKey::default_allow_swap_key");
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize, Clone)]
|
||||
pub struct LocalConfig {
|
||||
|
Loading…
Reference in New Issue
Block a user