mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
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 <dkaspar@blackberry.com> Reviewed-on: https://git.eclipse.org/r/23800 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
This commit is contained in:
parent
f9e4bbf0a3
commit
698788ea71
2 changed files with 18 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue