Skip to content

Commit

Permalink
fixed: build errors with ENABLE_SFTP=1
Browse files Browse the repository at this point in the history
closes: #3335
  • Loading branch information
eranif committed Mar 15, 2024
1 parent d54c081 commit 703f067
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion CodeFormatter/GenericFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}

Expand Down Expand Up @@ -296,4 +305,4 @@ void GenericFormatter::OnRemoteCommandError(clCommandEvent& event)
return;
}
m_inFlightFiles.erase(m_inFlightFiles.begin());
}
}
2 changes: 1 addition & 1 deletion Plugin/wxTerminalCtrl/wxTerminalCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions git/git.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "overlaytool.h"
#include "project.h"
#include "workspace.h"
#include "StringUtils.h"

#include <stack>
#include <unordered_set>
Expand Down

0 comments on commit 703f067

Please sign in to comment.