| 350 | } |
| 351 | |
| 352 | QModelIndex CRemoteFileSystemModel::SetRootPath(const QString &szPath) |
| 353 | { |
| 354 | if(szPath.isEmpty()) return QModelIndex(); |
| 355 | if(m_pRoot && m_pRoot->GetPath() == szPath) |
| 356 | return index(m_pRoot); |
| 357 | beginResetModel(); |
| 358 | m_GetFolder.clear(); |
| 359 | if(m_pRoot) { |
| 360 | DeleteRemoteFileSystem(m_pRoot); |
| 361 | m_pRoot = nullptr; |
| 362 | } |
| 363 | m_pRoot = new CRemoteFileSystem(szPath, CRemoteFileSystem::TYPE::DIR); |
| 364 | QModelIndex idx = index(m_pRoot); |
| 365 | endResetModel(); |
| 366 | qDebug(log) << "SetRootPath:" << this << idx << szPath; |
| 367 | return idx; |
| 368 | } |
| 369 | |
| 370 | CRemoteFileSystem* CRemoteFileSystemModel::GetRoot() |
| 371 | { |
no test coverage detected