Commit 895207be authored by Daniel Teske's avatar Daniel Teske

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: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 66757653
......@@ -1253,8 +1253,6 @@ void ProjectExplorerPlugin::closeAllProjects()
void ProjectExplorerPlugin::extensionsInitialized()
{
d->m_proWindow->extensionsInitialized();
// Register factories for all project managers
QList<IProjectManager*> projectManagers =
ExtensionSystem::PluginManager::getObjects<IProjectManager>();
......
......@@ -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);
......
......@@ -56,13 +56,11 @@ public:
~ProjectWindow();
void aboutToShutdown();
void extensionsInitialized();
public slots:
void projectUpdated(ProjectExplorer::Project *p);
private slots:
void handleKitChanges();
void showProperties(int index, int subIndex);
void registerProject(ProjectExplorer::Project*);
bool deregisterProject(ProjectExplorer::Project*);
......@@ -70,14 +68,12 @@ private slots:
void removedTarget(ProjectExplorer::Target*);
private:
bool hasTarget(ProjectExplorer::Project *project);
void removeCurrentWidget();
DoubleTabWidget *m_tabWidget;
QStackedWidget *m_centralWidget;
QWidget *m_currentWidget;
QList<ProjectExplorer::Project *> m_tabIndexToProject;
QMap<ProjectExplorer::Project *, bool> m_hasTarget;
};
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment