1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Inlining method that was used only once

Source commit: c5ddd42debf2661beae413d7085511a82298c658
This commit is contained in:
Martin Prikryl
2023-10-26 12:08:52 +00:00
parent 4e38c83dbd
commit b28836e3fc
2 changed files with 14 additions and 25 deletions

View File

@@ -658,28 +658,6 @@ void __fastcall TSCPFileSystem::ReadCommandOutput(int Params, const UnicodeStrin
}
}
//---------------------------------------------------------------------------
void __fastcall TSCPFileSystem::ExecCommand(const UnicodeString & Cmd, int Params,
const UnicodeString & CmdString)
{
if (Params < 0)
{
Params = ecDefault;
}
TOperationVisualizer Visualizer(FTerminal->UseBusyCursor);
SendCommand(Cmd);
int COParams =
coWaitForLastLine |
FLAGMASK(FLAGSET(Params, ecRaiseExcept), coRaiseExcept) |
FLAGMASK(FLAGSET(Params, ecIgnoreWarnings), coIgnoreWarnings) |
FLAGMASK(FLAGSET(Params, ecReadProgress), coReadProgress) |
FLAGMASK(FLAGSET(Params, ecIgnoreStdErr), coIgnoreStdErr);
ReadCommandOutput(COParams, &CmdString);
}
//---------------------------------------------------------------------------
void TSCPFileSystem::InvalidOutputError(const UnicodeString & Command)
{
FTerminal->TerminalError(FMTLOAD(INVALID_OUTPUT_ERROR, (Command, Output->Text)));
@@ -691,7 +669,20 @@ void __fastcall TSCPFileSystem::ExecCommand(TFSCommand Cmd, const TVarRec * args
if (Params < 0) Params = ecDefault;
UnicodeString FullCommand = FCommandSet->FullCommand(Cmd, args, size);
UnicodeString Command = FCommandSet->Command(Cmd, args, size);
ExecCommand(FullCommand, Params, Command);
TOperationVisualizer Visualizer(FTerminal->UseBusyCursor);
SendCommand(Command);
int COParams =
coWaitForLastLine |
FLAGMASK(FLAGSET(Params, ecRaiseExcept), coRaiseExcept) |
FLAGMASK(FLAGSET(Params, ecIgnoreWarnings), coIgnoreWarnings) |
FLAGMASK(FLAGSET(Params, ecReadProgress), coReadProgress) |
FLAGMASK(FLAGSET(Params, ecIgnoreStdErr), coIgnoreStdErr);
ReadCommandOutput(COParams, &FullCommand);
if (Params & ecRaiseExcept)
{
Integer MinL = FCommandSet->MinLines[Cmd];

View File

@@ -114,8 +114,6 @@ private:
bool __fastcall IsLastLine(UnicodeString & Line);
static bool __fastcall IsTotalListingLine(const UnicodeString Line);
void __fastcall EnsureLocation();
void __fastcall ExecCommand(const UnicodeString & Cmd, int Params,
const UnicodeString & CmdString);
void __fastcall ExecCommand(TFSCommand Cmd, const TVarRec * args = NULL,
int size = 0, int Params = -1);
void InvalidOutputError(const UnicodeString & Command);