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

Method index

Plugins/FileTransfer/RemoteFileSystemModel.cpp:439–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439QModelIndex CRemoteFileSystemModel::index(const QString& szPath) const
440{
441 int r = 0;
442 qDebug(log) << Q_FUNC_INFO << szPath;
443 QModelIndex idxParent;
444 QModelIndex idx = index(0, 0);
445 while(idx.isValid()) {
446 idx = index(r++, 0, idxParent);
447 CRemoteFileSystem* pRemoteFileSystem = GetRemoteFileSystemFromIndex(idx);
448 if(!pRemoteFileSystem)
449 continue;
450 QString szDir = pRemoteFileSystem->GetPath();
451 qDebug(log) << szDir << szPath;
452 if(szDir == szPath)
453 return idx;
454 if(pRemoteFileSystem->GetType() & CRemoteFileSystem::TYPE::FILE) {
455 qDebug(log) << szDir << "Is file:";
456 continue;
457 }
458 if(szDir.right(1) != '/')
459 szDir += '/';
460 if(szPath.left(szDir.size()) == szDir) {
461 qDebug(log) << "Contain:" << szPath << szDir;
462 idxParent = idx;
463 r = 0;
464 continue;
465 }
466 }
467 return QModelIndex();
468}
469
470QModelIndex CRemoteFileSystemModel::index(CRemoteFileSystem* node, int column) const
471{

Callers 12

CreateDirMethod · 0.95
foreachFunction · 0.45
GetDesktopSizeMethod · 0.45
on_pbAdd_clickedMethod · 0.45
CDlgScreenCaptureMethod · 0.45
Q_LOGGING_CATEGORYFunction · 0.45
slotDisconnectedMethod · 0.45
foreachFunction · 0.45

Calls 6

isValidMethod · 0.80
GetPathMethod · 0.80
GetParentMethod · 0.80
IndexOfParentMethod · 0.80
GetChildMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected