本文整理汇总了C++中CFilterManager::GetActiveFilters方法的典型用法代码示例。如果您正苦于以下问题:C++ CFilterManager::GetActiveFilters方法的具体用法?C++ CFilterManager::GetActiveFilters怎么用?C++ CFilterManager::GetActiveFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFilterManager
的用法示例。
在下文中一共展示了CFilterManager::GetActiveFilters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DownloadDroppedFiles
bool CState::DownloadDroppedFiles(const CRemoteDataObject* pRemoteDataObject, const CLocalPath& path, bool queueOnly /*=false*/)
{
bool hasDirs = false;
bool hasFiles = false;
const std::list<CRemoteDataObject::t_fileInfo>& files = pRemoteDataObject->GetFiles();
for (std::list<CRemoteDataObject::t_fileInfo>::const_iterator iter = files.begin(); iter != files.end(); ++iter)
{
if (iter->dir)
hasDirs = true;
else
hasFiles = true;
}
if (hasDirs)
{
if (!IsRemoteConnected() || !IsRemoteIdle())
return false;
}
if (hasFiles)
m_pMainFrame->GetQueue()->QueueFiles(queueOnly, path, *pRemoteDataObject);
if (!hasDirs)
return true;
for (std::list<CRemoteDataObject::t_fileInfo>::const_iterator iter = files.begin(); iter != files.end(); ++iter)
{
if (!iter->dir)
continue;
CLocalPath newPath(path);
newPath.AddSegment(CQueueView::ReplaceInvalidCharacters(iter->name));
m_pRecursiveOperation->AddDirectoryToVisit(pRemoteDataObject->GetServerPath(), iter->name, newPath, iter->link);
}
if (m_pComparisonManager->IsComparing())
m_pComparisonManager->ExitComparisonMode();
CFilterManager filter;
m_pRecursiveOperation->StartRecursiveOperation(queueOnly ? CRecursiveOperation::recursive_addtoqueue : CRecursiveOperation::recursive_download, pRemoteDataObject->GetServerPath(), filter.GetActiveFilters(false));
return true;
}
示例2: OnMenuDelete
void CRemoteTreeView::OnMenuDelete(wxCommandEvent&)
{
if (!m_pState->IsRemoteIdle())
return;
if (!m_contextMenuItem)
return;
const CServerPath& path = GetPathFromItem(m_contextMenuItem);
if (path.empty())
return;
if (wxMessageBoxEx(_("Really delete all selected files and/or directories from the server?"), _("Confirmation needed"), wxICON_QUESTION | wxYES_NO, this) != wxYES)
return;
const bool hasParent = path.HasParent();
CRecursiveOperation* pRecursiveOperation = m_pState->GetRecursiveOperationHandler();
CServerPath startDir;
if (hasParent)
{
const wxString& name = GetItemText(m_contextMenuItem);
startDir = path.GetParent();
pRecursiveOperation->AddDirectoryToVisit(startDir, name);
}
else
{
startDir = path;
pRecursiveOperation->AddDirectoryToVisit(startDir, _T(""));
}
CServerPath currentPath;
const wxTreeItemId selected = GetSelection();
if (selected)
currentPath = GetPathFromItem(selected);
if (!currentPath.empty() && (path == currentPath || path.IsParentOf(currentPath, false)))
currentPath = startDir;
CFilterManager filter;
pRecursiveOperation->StartRecursiveOperation(CRecursiveOperation::recursive_delete, startDir, filter.GetActiveFilters(false), !hasParent, currentPath);
}
示例3: OnMenuChmod
void CRemoteTreeView::OnMenuChmod(wxCommandEvent&)
{
if (!m_pState->IsRemoteIdle())
return;
if (!m_contextMenuItem)
return;
const CServerPath& path = GetPathFromItem(m_contextMenuItem);
if (path.empty())
return;
const bool hasParent = path.HasParent();
CChmodDialog* pChmodDlg = new CChmodDialog;
// Get current permissions of directory
const wxString& name = GetItemText(m_contextMenuItem);
char permissions[9] = {0};
bool cached = false;
// Obviously item needs to have a parent directory...
if (hasParent)
{
const CServerPath& parentPath = path.GetParent();
CDirectoryListing listing;
// ... and it needs to be cached
cached = m_pState->m_pEngine->CacheLookup(parentPath, listing) == FZ_REPLY_OK;
if (cached)
{
for (unsigned int i = 0; i < listing.GetCount(); i++)
{
if (listing[i].name != name)
continue;
pChmodDlg->ConvertPermissions(*listing[i].permissions, permissions);
}
}
}
if (!pChmodDlg->Create(this, 0, 1, name, permissions))
{
pChmodDlg->Destroy();
pChmodDlg = 0;
return;
}
if (pChmodDlg->ShowModal() != wxID_OK)
{
pChmodDlg->Destroy();
pChmodDlg = 0;
return;
}
// State may have changed while chmod dialog was shown
if (!m_contextMenuItem || !m_pState->IsRemoteConnected() || !m_pState->IsRemoteIdle())
{
pChmodDlg->Destroy();
pChmodDlg = 0;
return;
}
const int applyType = pChmodDlg->GetApplyType();
CRecursiveOperation* pRecursiveOperation = m_pState->GetRecursiveOperationHandler();
if (cached) // Implies hasParent
{
// Change directory permissions
if (!applyType || applyType == 2)
{
wxString newPerms = pChmodDlg->GetPermissions(permissions, true);
m_pState->m_pCommandQueue->ProcessCommand(new CChmodCommand(path.GetParent(), name, newPerms));
}
if (pChmodDlg->Recursive())
// Start recursion
pRecursiveOperation->AddDirectoryToVisit(path, _T(""), CLocalPath());
}
else
{
if (hasParent)
pRecursiveOperation->AddDirectoryToVisitRestricted(path.GetParent(), name, pChmodDlg->Recursive());
else
pRecursiveOperation->AddDirectoryToVisitRestricted(path, _T(""), pChmodDlg->Recursive());
}
if (!cached || pChmodDlg->Recursive())
{
pRecursiveOperation->SetChmodDialog(pChmodDlg);
CServerPath currentPath;
const wxTreeItemId selected = GetSelection();
if (selected)
currentPath = GetPathFromItem(selected);
CFilterManager filter;
pRecursiveOperation->StartRecursiveOperation(CRecursiveOperation::recursive_chmod, hasParent ? path.GetParent() : path, filter.GetActiveFilters(false), !cached, currentPath);
}
//.........这里部分代码省略.........
示例4: OnMenuDownload
void CRemoteTreeView::OnMenuDownload(wxCommandEvent& event)
{
CLocalPath localDir = m_pState->GetLocalDir();
if (!localDir.IsWriteable())
{
wxBell();
return;
}
if (!m_pState->IsRemoteIdle())
return;
if (!m_contextMenuItem)
return;
const CServerPath& path = GetPathFromItem(m_contextMenuItem);
if (path.empty())
return;
const wxString& name = GetItemText(m_contextMenuItem);
localDir.AddSegment(CQueueView::ReplaceInvalidCharacters(name));
CRecursiveOperation* pRecursiveOperation = m_pState->GetRecursiveOperationHandler();
pRecursiveOperation->AddDirectoryToVisit(path, _T(""), localDir);
CServerPath currentPath;
const wxTreeItemId selected = GetSelection();
if (selected)
currentPath = GetPathFromItem(selected);
const bool addOnly = event.GetId() == XRCID("ID_ADDTOQUEUE");
CFilterManager filter;
pRecursiveOperation->StartRecursiveOperation(addOnly ? CRecursiveOperation::recursive_addtoqueue : CRecursiveOperation::recursive_download, path, filter.GetActiveFilters(false), true, currentPath);
}