Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Set property indexAllFiles


In order to run a test, I need to set the property KEY_INDEX_ALL_FILES to true. I try doing so, but apparently it does not work since PDOM did not contains the expected entries:

   private boolean forceIndexAllFiles() throws CModelException {
       // get the preferences
       IPreferencesService prefService = Platform.getPreferencesService();
Preferences[] prefs = {new ProjectScope(fProject.getProject()).getNode(CCorePlugin.PLUGIN_ID).node("indexer")};

       String restore = prefService.get("indexAllFiles", "false", prefs);
       prefs[0].put("indexAllFiles", "true");

       return restore.equalsIgnoreCase("true");

And then, I force the indexer to index the project again:

       // Get the name of the project
       String projectName = fProject.getName();

       // Retrieve the CProject
       ICProject cproject = CCorePlugin.getDefault().getCoreModel()

       // If no CProject can be found, there is no need to continue

       IIndexManager indexManager = CCorePlugin.getIndexManager();
       if (indexManager.isProjectIndexed(cproject)) {
indexManager.setIndexerId(cproject, IIndexManager.ID_FAST_INDEXER);

if (!indexManager.isIndexerIdle() || indexManager.isIndexerSetupPostponed(cproject)) { indexManager.joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());

I think that I may have to tell the Indexer that the property has changed, but I don't know how.

I'm running this test with CDT 4.0.


Back to the top