Call: Use signal slots uniformly for calling.

This commit is contained in:
2025-06-19 15:37:39 +08:00
parent b2aa0d3752
commit 5f5569495e
14 changed files with 121 additions and 102 deletions

View File

@@ -1,14 +1,18 @@
#include "RemoteFile.h"
#include "RemoteFile.h"
#include <InfoPack.hpp>
#include "LocalFile.h"
RemoteFile::RemoteFile(QObject* parent) : DirFileHelper(parent)
{
}
void RemoteFile::setClientCore(ClientCore* cliCore)
{
cliCore_ = cliCore;
cliCore_->SetPathCall(pathCall_);
cliCore_->SetFileCall(fileCall_);
connect(cliCore_, &ClientCore::sigPath, this, [this](const QString& path) { sigHome(path); });
connect(cliCore_, &ClientCore::sigFiles, this, [this](const DirFileInfoVec& files) { sigDirFile(files); });
}
bool RemoteFile::GetHome()
@@ -21,6 +25,7 @@ bool RemoteFile::GetHome()
bool RemoteFile::GetDirFile(const QString& dir)
{
InfoMsg info;
info.msg = dir;
auto frame = cliCore_->GetBuffer(info, FBT_CLI_ASK_DIRFILE, cliCore_->GetRemoteID());
return ClientCore::asyncInvoke(cliCore_, [this, frame]() { return cliCore_->Send(frame); });
}