From 698788ea71444e64f528ad609594b3dbd3df269d Mon Sep 17 00:00:00 2001 From: David Kaspar Date: Mon, 24 Mar 2014 14:13:10 +0100 Subject: [PATCH] Bug 431012: Missing IQMakeProjectInfo.updateQMakeInfo() Adding IQMakeProjectInfo.updateQMakeInfo():QMakeInfo method to allow explicit calculation of QMakeInfo at the time of the method call. Change-Id: I665bedd5e095d1968f0c39ff2abb19c60aac9e14 Signed-off-by: David Kaspar Reviewed-on: https://git.eclipse.org/r/23800 Reviewed-by: Doug Schaefer IP-Clean: Doug Schaefer Tested-by: Doug Schaefer --- .../cdt/internal/qt/core/index/QMakeProjectInfo.java | 11 +++++++++-- .../eclipse/cdt/qt/core/index/IQMakeProjectInfo.java | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java index c3cfa866aca..d611febd0b8 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java @@ -75,11 +75,13 @@ public final class QMakeProjectInfo implements IQMakeProjectInfo { // must not be called under any QMake-related sync-lock, except for workspace lock // we are running outside of synchronized block to prevent deadlock involving workspace lock // this means that theoretically there might be multiple thread calculating the same results but only the last one wins - void updateState() { + State updateState() { // note that getProjectDescription might acquire workspace lock ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(project); ICConfigurationDescription configuration = projectDescription != null ? projectDescription.getActiveConfiguration() : null; - setState(configuration != null ? new State(configuration) : STATE_INVALID); + State newState = configuration != null ? new State(configuration) : STATE_INVALID; + setState(newState); + return newState; } private void setState(State newState) { @@ -125,6 +127,11 @@ public final class QMakeProjectInfo implements IQMakeProjectInfo { } } + @Override + public IQMakeInfo updateActualInfo() { + return updateState().getQMakeInfo(); + } + // converts IFile to absolute path private static String toFilePath(IFile file) { if (file != null) { diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java index 60edc762bb8..4a06cbabade 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/index/IQMakeProjectInfo.java @@ -31,10 +31,17 @@ public interface IQMakeProjectInfo { /** * Returns an actual QMake information. * - * Note that this is a long-term operation and the method call is blocked until an actual QMake information is calculated. - * * @return non-null IQMakeInfo instance representing the actual QMake information */ IQMakeInfo getActualInfo(); + /** + * Updates the actual QMake information and returns it. + * + * Note that this is a long-term operation and the method call is blocked until an actual QMake information is calculated. + * + * @return non-null IQMakeInfo instance representing the actual QMake information calculated at the time of this method call. + */ + IQMakeInfo updateActualInfo(); + }