MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / SetRootPath

Method SetRootPath

Plugins/FileTransfer/RemoteFileSystemModel.cpp:352–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352QModelIndex 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
370CRemoteFileSystem* CRemoteFileSystemModel::GetRoot()
371{

Callers 3

Q_LOGGING_CATEGORYFunction · 0.80
on_treeRemote_clickedMethod · 0.80

Calls 2

GetPathMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected