1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

Bug 574333 - Per-project Doxygen options are not flushed until saved a second time

When the options are applied in performApply, the call
DocCommentOwnerManager.setCommentOwner causes to set the
CProjectDescription, which causes UserDefinedEnvironmentSupplier to
flush cdt.core preferences. Then DocCommentOwnerArea.apply populates the
preference storage, but the preferences are not flushed after that
therefore the new options values only exist in memory.

Swapping the calls of DocCommentOwnerManager.setCommentOwner and
DocCommentOwnerArea.apply works but it makes no sense for the flushing
of Documentation options to depend on UserDefinedEnvironmentSupplier
flushing the preferences - it would work by a lucky accident.

A clean option would be to go through the preference's page
IWorkingCopyManager but this would involve a lot of more risky changes
in the DocOwner/Doxygen code and a vast majority of CDT code does not do
that.

Instead, this change explicitly calls CCoreInternals.savePreferences
which flushes the preferences, just like Indexer options does.

Change-Id: Id9a57cde47794f57f26ae295ec01eeb1df9aa120
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
This commit is contained in:
Marc-Andre Laperle 2021-06-20 00:03:44 -04:00
parent 90b3ebc1df
commit 987d11ef42

View file

@ -16,6 +16,7 @@
package org.eclipse.cdt.ui.dialogs;
import org.eclipse.cdt.doxygen.core.DoxygenPreferences;
import org.eclipse.cdt.internal.core.CCoreInternals;
import org.eclipse.cdt.internal.ui.dialogs.DocCommentOwnerArea;
import org.eclipse.cdt.internal.ui.text.doctools.DocCommentOwnerManager;
import org.eclipse.cdt.ui.text.doctools.IDocCommentOwner;
@ -120,6 +121,7 @@ public class DocCommentOwnerBlock extends AbstractCOptionPage {
fManager.setCommentOwner(project, newOwner, true);
}
docCommentOwnerArea.apply(doxygenPreferences.projectStorage(project));
CCoreInternals.savePreferences(project, true);
}
public IProject getProject() {