forked from qt-creator/qt-creator
ProjectWindow: Remove unnecessary code
Since projects without targets are special, this code apparently tracked if hasTarget() changed due to a kitUpdate. But we are already connected to targetRemoved() and checks whether a project has no target anymore. Thus this code is redundant and can be removed. Change-Id: I245887075509ed4c0ecda383de0227ccbc58b9af Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -92,11 +92,6 @@ ProjectWindow::~ProjectWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void ProjectWindow::extensionsInitialized()
|
||||
{
|
||||
connect(KitManager::instance(), SIGNAL(kitsChanged()), this, SLOT(handleKitChanges()));
|
||||
}
|
||||
|
||||
void ProjectWindow::aboutToShutdown()
|
||||
{
|
||||
showProperties(-1, -1); // that's a bit stupid, but otherwise stuff is still
|
||||
@@ -122,27 +117,6 @@ void ProjectWindow::projectUpdated(Project *p)
|
||||
m_tabWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void ProjectWindow::handleKitChanges()
|
||||
{
|
||||
bool changed = false;
|
||||
int index = m_tabWidget->currentIndex();
|
||||
QList<Project *> projects = m_tabIndexToProject;
|
||||
foreach (ProjectExplorer::Project *project, projects) {
|
||||
if (m_hasTarget.value(project) != hasTarget(project)) {
|
||||
changed = true;
|
||||
if (deregisterProject(project))
|
||||
registerProject(project);
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
m_tabWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
bool ProjectWindow::hasTarget(ProjectExplorer::Project *project)
|
||||
{
|
||||
return !project->targets().isEmpty();
|
||||
}
|
||||
|
||||
void ProjectWindow::registerProject(ProjectExplorer::Project *project)
|
||||
{
|
||||
if (!project || m_tabIndexToProject.contains(project))
|
||||
@@ -160,9 +134,6 @@ void ProjectWindow::registerProject(ProjectExplorer::Project *project)
|
||||
|
||||
QStringList subtabs;
|
||||
|
||||
bool projectHasTarget = hasTarget(project);
|
||||
m_hasTarget.insert(project, projectHasTarget);
|
||||
|
||||
// Add the project specific pages
|
||||
QList<IProjectPanelFactory *> factories = ExtensionSystem::PluginManager::getObjects<IProjectPanelFactory>();
|
||||
Utils::sort(factories, &IProjectPanelFactory::prioritySort);
|
||||
|
||||
Reference in New Issue
Block a user