| 609 | } |
| 610 | |
| 611 | void CRemoteFileSystemModel::CreateDir(QModelIndex index, const QString &dir) |
| 612 | { |
| 613 | auto p = GetRemoteFileSystemFromIndex(index); |
| 614 | if(!p) p = m_pRoot; |
| 615 | if(p && !p->GetPath().isEmpty()) { |
| 616 | QString szPath = p->GetPath() + "/" + dir; |
| 617 | if(p->IndexOf(szPath) > -1) { |
| 618 | qCritical(log) << "The path is exist:" << szPath; |
| 619 | QMessageBox::critical(nullptr, tr("Error"), tr("The path is exist: %1").arg(szPath)); |
| 620 | return; |
| 621 | } |
| 622 | emit sigMakeDir(szPath); |
| 623 | p->SetState(CRemoteFileSystem::State::No); |
| 624 | fetchMore(parent(this->index(p))); |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | void CRemoteFileSystemModel::RemoveDir(QModelIndex index) |
| 629 | { |