remove: get root callback.

This commit is contained in:
2025-06-20 16:05:37 +08:00
parent a019a5ea78
commit 6941e1b893
6 changed files with 5 additions and 28 deletions

View File

@@ -39,17 +39,11 @@ void FileManager::SetModeStr(const QString& modeStr, int type, ClientCore* clien
ui->tableWidget->setOwnIDCall([this]() { return cliCore_->GetOwnID(); });
ui->tableWidget->setRemoteIDCall([this]() { return cliCore_->GetRemoteID(); });
ui->tableWidget->setBasePathCall([this]() { return GetRoot(); });
connect(fileHelper_.get(), &DirFileHelper::sigHome, this, &FileManager::ShowPath);
connect(fileHelper_.get(), &DirFileHelper::sigDirFile, this, &FileManager::ShowFile);
}
void FileManager::SetOtherSideCall(const std::function<QString()>& call)
{
ui->tableWidget->setOtherSideCall(call);
}
void FileManager::InitControl()
{
QStringList headers;

View File

@@ -24,7 +24,6 @@ public:
public:
QString GetRoot();
void SetModeStr(const QString& modeStr, int type = 0, ClientCore* clientCore = nullptr);
void SetOtherSideCall(const std::function<QString()>& call);
signals:
void sigSendTasks(const QVector<TransTask>& tasks);

View File

@@ -22,11 +22,6 @@ void CustomTableWidget::setIsRemote(bool isRemote)
isRemote_ = isRemote;
}
void CustomTableWidget::setBasePathCall(const std::function<QString()>& call)
{
basePathCall_ = call;
}
void CustomTableWidget::setOwnIDCall(const std::function<QString()>& call)
{
oidCall_ = call;
@@ -37,11 +32,6 @@ void CustomTableWidget::setRemoteIDCall(const std::function<QString()>& call)
ridCall_ = call;
}
void CustomTableWidget::setOtherSideCall(const std::function<QString()>& call)
{
otherSideCall_ = call;
}
void CustomTableWidget::dropEvent(QDropEvent* event)
{
if (!event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist")) {
@@ -65,11 +55,11 @@ void CustomTableWidget::dropEvent(QDropEvent* event)
task.localId = oidCall_();
task.remoteId = ridCall_();
if (isRemote_) {
task.remotePath = basePathCall_();
task.localPath = Util::Join(otherSideCall_(), roleData[Qt::DisplayRole].toString());
task.remotePath = GlobalData::Ins()->GetRemoteRoot();
task.localPath = Util::Join(GlobalData::Ins()->GetLocalRoot(), roleData[Qt::DisplayRole].toString());
} else {
task.localPath = basePathCall_();
task.remotePath = Util::Join(otherSideCall_(), roleData[Qt::DisplayRole].toString());
task.localPath = GlobalData::Ins()->GetLocalRoot();
task.remotePath = Util::Join(GlobalData::Ins()->GetRemoteRoot(), roleData[Qt::DisplayRole].toString());
}
tasks.push_back(task);
}

View File

@@ -17,10 +17,8 @@ signals:
public:
void setIsRemote(bool isRemote);
void setBasePathCall(const std::function<QString()>& call);
void setOwnIDCall(const std::function<QString()>& call);
void setRemoteIDCall(const std::function<QString()>& call);
void setOtherSideCall(const std::function<QString()>& call);
protected:
void dropEvent(QDropEvent* event) override;
@@ -29,8 +27,6 @@ protected:
protected:
bool isRemote_{false};
QPoint startPos_;
std::function<QString()> basePathCall_;
std::function<QString()> otherSideCall_;
std::function<QString()> oidCall_;
std::function<QString()> ridCall_;
};