code: Establish the theoretical transmission process.

This commit is contained in:
2025-06-18 15:10:28 +08:00
parent a53657df30
commit 5dee6ea41d
7 changed files with 24 additions and 16 deletions

View File

@@ -42,11 +42,6 @@ void FileManager::SetModeStr(const QString& modeStr, int type, ClientCore* clien
ui->tableWidget->setBasePathCall([this]() { return curRoot_; });
}
void FileManager::SetOtherSidePathCall(const std::function<QString()>& call)
{
ui->tableWidget->setOtherSidePathCall(call);
}
void FileManager::InitControl()
{
QStringList headers;
@@ -77,6 +72,8 @@ void FileManager::InitControl()
connect(ui->btnVisit, &QPushButton::clicked, this, &FileManager::evtFile);
connect(ui->tableWidget, &QTableWidget::cellDoubleClicked, this, &FileManager::doubleClick);
connect(ui->btnUp, &QPushButton::clicked, this, &FileManager::evtUp);
connect(ui->tableWidget, &CustomTableWidget::sigTasks, this,
[this](const QVector<TransTask>& tasks) { emit sigSendTasks(tasks); });
}
void FileManager::InitMenu(bool remote)

View File

@@ -2,6 +2,7 @@
#define FILECONTROL_H
#include <ClientCore.h>
#include <FileTrans.h>
#include <InfoDirFile.h>
#include <QWidget>
#include <Util.h>
@@ -21,9 +22,11 @@ public:
public:
void SetModeStr(const QString& modeStr, int type = 0, ClientCore* clientCore = nullptr);
void SetOtherSidePathCall(const std::function<QString()>& call);
QString GetCurRoot();
signals:
void sigSendTasks(const QVector<TransTask>& tasks);
private:
void InitControl();
void InitMenu(bool remote = false);

View File

@@ -26,11 +26,6 @@ void CustomTableWidget::setBasePathCall(const std::function<QString()>& call)
basePathCall_ = call;
}
void CustomTableWidget::setOtherSidePathCall(const std::function<QString()>& call)
{
otherSideCall_ = call;
}
QString FileManager::GetCurRoot()
{
return curRoot_;
@@ -74,10 +69,10 @@ void CustomTableWidget::dragEnterEvent(QDragEnterEvent* event)
task.remoteId = ridCall_();
if (isRemote_) {
task.remotePath = basePathCall_();
task.localPath = Util::Join(otherSideCall_(), df.name);
task.localPath = Util::Join(dirinfo.root, df.name);
}
else {
task.remotePath = Util::Join(otherSideCall_(), df.name);
task.remotePath = Util::Join(dirinfo.root, df.name);
task.localPath = basePathCall_();
}
tasks.push_back(task);
@@ -106,6 +101,7 @@ void CustomTableWidget::mouseMoveEvent(QMouseEvent* event)
if (item->column() == 1) {
DirFileInfo df;
df.name = item->text();
v.vec.push_back(df);
}
}
mimeData->setData("application/x-custom-data", infoPack<DirFileInfoVec>(v));

View File

@@ -18,7 +18,6 @@ signals:
public:
void setIsRemote(bool isRemote);
void setBasePathCall(const std::function<QString()>& call);
void setOtherSidePathCall(const std::function<QString()>& call);
void setOwnIDCall(const std::function<QString()>& call);
void setRemoteIDCall(const std::function<QString()>& call);