diff --git a/CodeFormatter/GenericFormatter.cpp b/CodeFormatter/GenericFormatter.cpp index 9aa14ae05a..ef6fb6e566 100644 --- a/CodeFormatter/GenericFormatter.cpp +++ b/CodeFormatter/GenericFormatter.cpp @@ -79,19 +79,23 @@ GenericFormatter::GenericFormatter() { SetWorkingDirectory("$(WorkspacePath)"); Bind(wxEVT_SHELL_ASYNC_PROCESS_TERMINATED, &GenericFormatter::OnAsyncShellProcessTerminated, this); +#if USE_SFTP Bind(wxEVT_SFTP_ASYNC_EXEC_STDERR, &GenericFormatter::OnRemoteCommandStderr, this); Bind(wxEVT_SFTP_ASYNC_EXEC_STDOUT, &GenericFormatter::OnRemoteCommandStdout, this); Bind(wxEVT_SFTP_ASYNC_EXEC_DONE, &GenericFormatter::OnRemoteCommandDone, this); Bind(wxEVT_SFTP_ASYNC_EXEC_ERROR, &GenericFormatter::OnRemoteCommandError, this); +#endif } GenericFormatter::~GenericFormatter() { Unbind(wxEVT_SHELL_ASYNC_PROCESS_TERMINATED, &GenericFormatter::OnAsyncShellProcessTerminated, this); +#if USE_SFTP Unbind(wxEVT_SFTP_ASYNC_EXEC_STDERR, &GenericFormatter::OnRemoteCommandStderr, this); Unbind(wxEVT_SFTP_ASYNC_EXEC_STDOUT, &GenericFormatter::OnRemoteCommandStdout, this); Unbind(wxEVT_SFTP_ASYNC_EXEC_DONE, &GenericFormatter::OnRemoteCommandDone, this); Unbind(wxEVT_SFTP_ASYNC_EXEC_ERROR, &GenericFormatter::OnRemoteCommandError, this); +#endif } wxString GenericFormatter::GetCommandAsString() const { return join_array(m_command); } @@ -136,6 +140,7 @@ bool GenericFormatter::FormatFile(const wxFileName& filepath, wxEvtHandler* sink bool GenericFormatter::FormatRemoteFile(const wxString& filepath, wxEvtHandler* sink) { +#if USE_SFTP if (!CanHandleRemoteFile()) { return false; } @@ -151,6 +156,10 @@ bool GenericFormatter::FormatRemoteFile(const wxString& filepath, wxEvtHandler* clSFTPManager::Get().AsyncExecute(this, clRemoteHost::Instance()->GetActiveAccount(), cmd, wd, nullptr); m_inFlightFiles.push_back({ filepath, sink }); +#else + wxUnusedVar(filepath); + wxUnusedVar(sink); +#endif return true; } @@ -296,4 +305,4 @@ void GenericFormatter::OnRemoteCommandError(clCommandEvent& event) return; } m_inFlightFiles.erase(m_inFlightFiles.begin()); -} \ No newline at end of file +} diff --git a/Plugin/wxTerminalCtrl/wxTerminalCtrl.cpp b/Plugin/wxTerminalCtrl/wxTerminalCtrl.cpp index 14ba25908c..7a1c618ddf 100644 --- a/Plugin/wxTerminalCtrl/wxTerminalCtrl.cpp +++ b/Plugin/wxTerminalCtrl/wxTerminalCtrl.cpp @@ -294,7 +294,7 @@ void wxTerminalCtrl::SSHAndSetWorkingDirectory(const wxString& ssh_account, cons Run(command); #else wxUnusedVar(ssh_account); - wxUnusedVar(remote_workspace_file); + wxUnusedVar(path); #endif } diff --git a/git/git.cpp b/git/git.cpp index c52d16f7a2..e1f187e2a3 100644 --- a/git/git.cpp +++ b/git/git.cpp @@ -57,6 +57,7 @@ #include "overlaytool.h" #include "project.h" #include "workspace.h" +#include "StringUtils.h" #include #include