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

@@ -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);
}