From 8b2cff4b8b79e83451666d8b3b08ad971c1c2121 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 21 Aug 2014 15:22:08 +0200 Subject: C++: introduce the unique ProjectPart::id() And change the code-model inspector dialog to use them in the ProjectParts tab to sync the master/details view, and in the CppPreProcessorDialog to save/reload the selected part. Change-Id: I7cc8ac1c21d31122f8650985d0b85177ebabdfb8 Reviewed-by: Nikolai Kosjar --- src/plugins/cppeditor/cpppreprocessordialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/cppeditor/cpppreprocessordialog.cpp') diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp index 0366069ae6..d470bdeec7 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.cpp +++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp @@ -57,7 +57,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil CppSnippetProvider().decorateEditor(m_ui->editWidget); - const QString ¤tProjectFile = ProjectExplorer::SessionManager::value( + const QString &projectPartIdToUse = ProjectExplorer::SessionManager::value( QLatin1String(Constants::CPP_PREPROCESSOR_PROJECT_PREFIX) + m_filePath).toString(); int currentIndex = 0; @@ -70,7 +70,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil addition.projectPart = projectPart; addition.additionalDirectives = ProjectExplorer::SessionManager::value( projectPart->projectFile + QLatin1Char(',') + m_filePath).toString(); - if (projectPart->projectFile == currentProjectFile) + if (projectPart->id() == projectPartIdToUse) currentIndex = m_ui->projectComboBox->count() - 1; m_partAdditions << addition; } @@ -95,7 +95,7 @@ int CppPreProcessorDialog::exec() ProjectExplorer::SessionManager::setValue( QLatin1String(Constants::CPP_PREPROCESSOR_PROJECT_PREFIX) + m_filePath, - m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart->projectFile); + m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart->id()); foreach (ProjectPartAddition partAddition, m_partAdditions) { const QString &previousDirectives = ProjectExplorer::SessionManager::value( -- cgit v1.2.1