本文整理汇总了C++中ProjectsArray::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectsArray::push_back方法的具体用法?C++ ProjectsArray::push_back怎么用?C++ ProjectsArray::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectsArray
的用法示例。
在下文中一共展示了ProjectsArray::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadProject
void ProjectManager::ReloadProject(cbProject *project)
{
m_ui->FreezeTree();
bool workspaceModified = m_pWorkspace ? m_pWorkspace->GetModified() : false;
wxString name = project->GetFilename();
wxString activeProjectName = m_pActiveProject ? m_pActiveProject->GetFilename() : wxString(wxEmptyString);
ProjectsArray projectDependencies; // all projects that the reloaded project depends on
ProjectsArray projectsDependingOnReloaded; // all projects that depend on the reloaded project
for (DepsMap::iterator it = m_ProjectDeps.begin(); it != m_ProjectDeps.end(); ++it)
{
if (!it->second)
continue;
if (it->first == project)
projectDependencies = *(it->second);
else
{
if (it->second->Index(project) != wxNOT_FOUND)
projectsDependingOnReloaded.push_back(it->first);
}
}
int originalPosition = m_pProjects->Index(project);
CloseProject(project);
cbProject *loadedProject = LoadProject(name);
if (loadedProject)
{
if (!projectDependencies.empty())
{
for (ProjectsArray::iterator it = projectDependencies.begin(); it != projectDependencies.end(); ++it)
AddProjectDependency(loadedProject, *it);
}
if (!projectsDependingOnReloaded.empty())
{
for (ProjectsArray::iterator it = projectsDependingOnReloaded.begin();
it != projectsDependingOnReloaded.end(); ++it)
{
AddProjectDependency(*it, loadedProject);
}
}
int loadedPosition = -1;
int index = 0;
cbProject *projectToActivate = nullptr;
for (ProjectsArray::iterator it = m_pProjects->begin(); it != m_pProjects->end(); ++it, ++index)
{
if (*it == loadedProject)
loadedPosition = index;
if ((*it)->GetFilename() == activeProjectName)
projectToActivate = *it;
}
m_pProjects->RemoveAt(loadedPosition);
m_pProjects->Insert(loadedProject, originalPosition);
if (projectToActivate)
m_pActiveProject = projectToActivate;
m_ui->RebuildTree();
if (m_pWorkspace)
m_pWorkspace->SetModified(workspaceModified);
}
m_ui->UnfreezeTree();
}