2025-06-19 15:37:39 +08:00
|
|
|
#include "RemoteFile.h"
|
2025-06-15 14:31:54 +08:00
|
|
|
|
|
|
|
|
#include <InfoPack.hpp>
|
2025-06-15 23:13:30 +08:00
|
|
|
|
2025-06-15 14:31:54 +08:00
|
|
|
#include "LocalFile.h"
|
|
|
|
|
|
2025-06-19 15:37:39 +08:00
|
|
|
RemoteFile::RemoteFile(QObject* parent) : DirFileHelper(parent)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-15 14:31:54 +08:00
|
|
|
void RemoteFile::setClientCore(ClientCore* cliCore)
|
|
|
|
|
{
|
|
|
|
|
cliCore_ = cliCore;
|
2025-06-19 15:37:39 +08:00
|
|
|
connect(cliCore_, &ClientCore::sigPath, this, [this](const QString& path) { sigHome(path); });
|
|
|
|
|
connect(cliCore_, &ClientCore::sigFiles, this, [this](const DirFileInfoVec& files) { sigDirFile(files); });
|
2025-06-15 14:31:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RemoteFile::GetHome()
|
|
|
|
|
{
|
|
|
|
|
InfoMsg info;
|
2025-06-19 11:59:32 +08:00
|
|
|
auto frame = cliCore_->GetBuffer(info, FBT_CLI_ASK_HOME, cliCore_->GetRemoteID());
|
2025-06-25 10:54:04 +08:00
|
|
|
return ClientCore::syncInvoke(cliCore_, frame);
|
2025-06-15 14:31:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RemoteFile::GetDirFile(const QString& dir)
|
|
|
|
|
{
|
|
|
|
|
InfoMsg info;
|
2025-06-19 15:37:39 +08:00
|
|
|
info.msg = dir;
|
2025-06-19 11:59:32 +08:00
|
|
|
auto frame = cliCore_->GetBuffer(info, FBT_CLI_ASK_DIRFILE, cliCore_->GetRemoteID());
|
2025-06-25 10:54:04 +08:00
|
|
|
return ClientCore::syncInvoke(cliCore_, frame);
|
2025-06-15 14:31:54 +08:00
|
|
|
}
|