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

Method CreateDir

Plugins/FileTransfer/RemoteFileSystemModel.cpp:611–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611void 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
628void CRemoteFileSystemModel::RemoveDir(QModelIndex index)
629{

Callers 1

slotTreeRemoteNewMethod · 0.80

Calls 5

indexMethod · 0.95
GetPathMethod · 0.80
IndexOfMethod · 0.80
SetStateMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected