| 531 | } |
| 532 | |
| 533 | void CRemoteFileSystemModel::fetchMore(const QModelIndex &parent) |
| 534 | { |
| 535 | qDebug(log) << Q_FUNC_INFO << parent; |
| 536 | auto p = GetRemoteFileSystemFromIndex(parent); |
| 537 | if(!p) p = m_pRoot; |
| 538 | if(!p) { |
| 539 | qCritical(log) << "fetchMore:" << parent << "The pointer is nullptr"; |
| 540 | return; |
| 541 | } |
| 542 | if(p->GetType() & CRemoteFileSystem::TYPE::FILE) { |
| 543 | qCritical(log) << "fetchMore:" << parent << "The node is file"; |
| 544 | return; |
| 545 | } |
| 546 | QString szPath = p->GetPath(); |
| 547 | if(szPath.isEmpty()) { |
| 548 | qCritical(log) << "fetchMore:" << parent << "The path is empty"; |
| 549 | return; |
| 550 | } |
| 551 | if(p->GetState() != CRemoteFileSystem::State::No) { |
| 552 | qDebug(log) << "fetchMore:" << parent << p->GetState() << "The state is not NO"; |
| 553 | return; |
| 554 | } |
| 555 | if(m_GetFolder.indexOf(p) != -1) |
| 556 | return; |
| 557 | m_GetFolder.append(p); |
| 558 | p->SetState(CRemoteFileSystem::State::Getting); |
| 559 | emit sigGetDir(p); |
| 560 | qDebug(log) << "fetchMore:" << parent << p << szPath; |
| 561 | } |
| 562 | |
| 563 | void CRemoteFileSystemModel::slotGetDir( |
| 564 | CRemoteFileSystem *p, |