fix: cfg unix forbidden in rust .82
Install.sh / build (push) Waiting to run
Linux / build (push) Waiting to run
MacOS / build (push) Waiting to run
Windows / build (push) Waiting to run

This commit is contained in:
veeso
2024-10-21 10:32:50 +02:00
parent 11559d0962
commit 69f821baef
22 changed files with 95 additions and 95 deletions
+2 -2
View File
@@ -280,12 +280,12 @@ impl AuthActivity {
fn load_bookmark_smb_into_gui(&mut self, form_tab: FormTab, params: SmbParams) {
self.mount_address(form_tab, params.address.as_str());
#[cfg(unix)]
#[cfg(posix)]
self.mount_port(form_tab, params.port);
self.mount_username(form_tab, params.username.as_deref().unwrap_or(""));
self.mount_password(form_tab, params.password.as_deref().unwrap_or(""));
self.mount_smb_share(form_tab, &params.share);
#[cfg(unix)]
#[cfg(posix)]
self.mount_smb_workgroup(form_tab, params.workgroup.as_deref().unwrap_or(""));
}
+3 -3
View File
@@ -952,14 +952,14 @@ impl Component<Msg, NoUserEvent> for InputSmbShare {
}
}
#[cfg(unix)]
#[cfg(posix)]
#[derive(MockComponent)]
pub struct InputSmbWorkgroup {
component: Input,
form_tab: FormTab,
}
#[cfg(unix)]
#[cfg(posix)]
impl InputSmbWorkgroup {
pub fn new(host: &str, form_tab: FormTab, color: Color) -> Self {
Self {
@@ -978,7 +978,7 @@ impl InputSmbWorkgroup {
}
}
#[cfg(unix)]
#[cfg(posix)]
impl Component<Msg, NoUserEvent> for InputSmbWorkgroup {
fn on(&mut self, ev: Event<NoUserEvent>) -> Option<Msg> {
let on_key_down = match self.form_tab {
+1 -1
View File
@@ -13,7 +13,7 @@ pub use bookmarks::{
BookmarkName, BookmarkSavePassword, BookmarksList, DeleteBookmarkPopup, DeleteRecentPopup,
RecentsList,
};
#[cfg(unix)]
#[cfg(posix)]
pub use form::InputSmbWorkgroup;
pub use form::{
HostBridgeProtocolRadio, InputAddress, InputKubeClientCert, InputKubeClientKey,
+1 -1
View File
@@ -151,7 +151,7 @@ impl AuthActivity {
if params.address.is_empty() {
return Err("Invalid address");
}
#[cfg(unix)]
#[cfg(posix)]
if params.port == 0 {
return Err("Invalid port");
}
+3 -3
View File
@@ -93,7 +93,7 @@ pub enum AuthFormId {
S3SecurityToken,
S3SessionToken,
SmbShare,
#[cfg(unix)]
#[cfg(posix)]
SmbWorkgroup,
Username,
WebDAVUri,
@@ -193,9 +193,9 @@ pub enum UiAuthFormMsg {
S3SessionTokenBlurUp,
SmbShareBlurDown,
SmbShareBlurUp,
#[cfg(unix)]
#[cfg(posix)]
SmbWorkgroupDown,
#[cfg(unix)]
#[cfg(posix)]
SmbWorkgroupUp,
UsernameBlurDown,
UsernameBlurUp,
+8 -8
View File
@@ -269,7 +269,7 @@ impl AuthActivity {
.active(match self.host_bridge_input_mask() {
InputMask::Localhost => unreachable!(),
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
#[cfg(unix)]
#[cfg(posix)]
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
#[cfg(windows)]
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
@@ -285,7 +285,7 @@ impl AuthActivity {
.active(match self.remote_input_mask() {
InputMask::Localhost => unreachable!(),
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
#[cfg(unix)]
#[cfg(posix)]
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
#[cfg(windows)]
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
@@ -400,7 +400,7 @@ impl AuthActivity {
.active(match self.host_bridge_input_mask() {
InputMask::Localhost => unreachable!(),
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
#[cfg(unix)]
#[cfg(posix)]
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
#[cfg(windows)]
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
@@ -416,7 +416,7 @@ impl AuthActivity {
.active(match self.remote_input_mask() {
InputMask::Localhost => unreachable!(),
InputMask::Generic => &Id::Remote(AuthFormId::Password),
#[cfg(unix)]
#[cfg(posix)]
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
#[cfg(windows)]
InputMask::Smb => &Id::Remote(AuthFormId::Password),
@@ -760,28 +760,28 @@ impl AuthActivity {
};
assert!(self.app.active(id).is_ok());
}
#[cfg(unix)]
#[cfg(posix)]
UiMsg::HostBridge(UiAuthFormMsg::SmbWorkgroupDown) => {
assert!(self
.app
.active(&Id::HostBridge(AuthFormId::RemoteDirectory))
.is_ok());
}
#[cfg(unix)]
#[cfg(posix)]
UiMsg::Remote(UiAuthFormMsg::SmbWorkgroupDown) => {
assert!(self
.app
.active(&Id::Remote(AuthFormId::RemoteDirectory))
.is_ok());
}
#[cfg(unix)]
#[cfg(posix)]
UiMsg::HostBridge(UiAuthFormMsg::SmbWorkgroupUp) => {
assert!(self
.app
.active(&Id::HostBridge(AuthFormId::Password))
.is_ok());
}
#[cfg(unix)]
#[cfg(posix)]
UiMsg::Remote(UiAuthFormMsg::SmbWorkgroupUp) => {
assert!(self.app.active(&Id::Remote(AuthFormId::Password)).is_ok());
}
+8 -8
View File
@@ -69,7 +69,7 @@ impl AuthActivity {
self.mount_kube_namespace(FormTab::HostBridge, "");
self.mount_kube_username(FormTab::HostBridge, "");
self.mount_smb_share(FormTab::HostBridge, "");
#[cfg(unix)]
#[cfg(posix)]
self.mount_smb_workgroup(FormTab::HostBridge, "");
self.mount_webdav_uri(FormTab::HostBridge, "");
@@ -102,7 +102,7 @@ impl AuthActivity {
self.mount_kube_namespace(FormTab::Remote, "");
self.mount_kube_username(FormTab::Remote, "");
self.mount_smb_share(FormTab::Remote, "");
#[cfg(unix)]
#[cfg(posix)]
self.mount_smb_workgroup(FormTab::Remote, "");
self.mount_webdav_uri(FormTab::Remote, "");
@@ -1042,7 +1042,7 @@ impl AuthActivity {
.is_ok());
}
#[cfg(unix)]
#[cfg(posix)]
pub(super) fn mount_smb_workgroup(&mut self, form_tab: FormTab, workgroup: &str) {
let color = self.theme().auth_address;
let id = Self::form_tab_id(form_tab, AuthFormId::SmbWorkgroup);
@@ -1130,7 +1130,7 @@ impl AuthActivity {
}
/// Collect s3 input values from view
#[cfg(unix)]
#[cfg(posix)]
pub(super) fn get_smb_params_input(&self, form_tab: FormTab) -> SmbParams {
let share: String = self.get_input_smb_share(form_tab);
let workgroup: Option<String> = self.get_input_smb_workgroup(form_tab);
@@ -1394,7 +1394,7 @@ impl AuthActivity {
}
}
#[cfg(unix)]
#[cfg(posix)]
pub(super) fn get_input_smb_workgroup(&self, form_tab: FormTab) -> Option<String> {
match self
.app
@@ -1494,7 +1494,7 @@ impl AuthActivity {
.unwrap_or_default()
)
}
#[cfg(unix)]
#[cfg(posix)]
ProtocolParams::Smb(params) => {
let username: String = match params.username {
None => String::default(),
@@ -1749,7 +1749,7 @@ impl AuthActivity {
}
}
#[cfg(unix)]
#[cfg(posix)]
fn get_host_bridge_smb_view(&self) -> [Id; 4] {
match self.app.focus() {
Some(
@@ -1796,7 +1796,7 @@ impl AuthActivity {
}
}
#[cfg(unix)]
#[cfg(posix)]
fn get_remote_smb_view(&self) -> [Id; 4] {
match self.app.focus() {
Some(