mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for Bug 54155 - [Scalability] Indexer bypassing filtering when project was closed and had no index
Fix for Search UI refresh on Linux
This commit is contained in:
parent
d324df3b25
commit
6f5c560309
5 changed files with 38 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-04-20 Bogdan Gheorghe
|
||||
Fix for Bug 54155
|
||||
|
||||
2004-04-12 Bogdan Gheorghe
|
||||
Added Indexer watchdog
|
||||
|
||||
|
|
|
@ -111,6 +111,10 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
|||
public void addSource(IFile resource, IPath indexedContainer){
|
||||
if (CCorePlugin.getDefault() == null) return;
|
||||
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
|
||||
|
||||
if (!jobSet.add(job.resource.getLocation()))
|
||||
return;
|
||||
|
||||
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
|
||||
// reduces the chance that the file is open later on, preventing it from being deleted
|
||||
if (!job.initializeContents()) return;
|
||||
|
@ -596,4 +600,15 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
|||
// TODO Auto-generated method stub
|
||||
return this.timeoutThread ;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.search.processing.JobManager#jobFinishedNotification(org.eclipse.cdt.internal.core.search.processing.IJob)
|
||||
*/
|
||||
protected void jobFinishedNotification(IJob job) {
|
||||
|
||||
if (job instanceof AddCompilationUnitToIndex){
|
||||
AddCompilationUnitToIndex tempJob = (AddCompilationUnitToIndex) job;
|
||||
jobSet.remove(tempJob.resource.getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,8 +13,10 @@
|
|||
*/
|
||||
package org.eclipse.cdt.internal.core.search.processing;
|
||||
|
||||
import java.util.HashSet;
|
||||
import org.eclipse.cdt.core.ICLogConstants;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.search.indexing.IndexRequest;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||
|
@ -39,6 +41,7 @@ public abstract class JobManager implements Runnable {
|
|||
|
||||
private int awaitingClients = 0;
|
||||
|
||||
protected HashSet jobSet = new HashSet();
|
||||
public static void verbose(String log) {
|
||||
System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
|
@ -320,6 +323,11 @@ public abstract class JobManager implements Runnable {
|
|||
return;
|
||||
}
|
||||
|
||||
IndexRequest tempJob = null;
|
||||
if (job instanceof IndexRequest)
|
||||
tempJob = (IndexRequest) job;
|
||||
|
||||
|
||||
// append the job to the list of ones to process later on
|
||||
int size = awaitingJobs.length;
|
||||
if (++jobEnd == size) { // when growing, relocate jobs starting at position 0
|
||||
|
@ -385,6 +393,7 @@ public abstract class JobManager implements Runnable {
|
|||
//if (status == FAILED) request(job);
|
||||
} finally {
|
||||
executing = false;
|
||||
jobFinishedNotification(currentJob());
|
||||
if (VERBOSE) {
|
||||
JobManager.verbose("FINISHED background job - " + job); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -448,4 +457,6 @@ public abstract class JobManager implements Runnable {
|
|||
return buffer.toString();
|
||||
}
|
||||
|
||||
protected abstract void jobFinishedNotification(IJob job);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2004-04-20 Bogdan Gheorghe
|
||||
Added clear() to CSearchResultPage to solve refresh problem on Linux.
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/search/CSearchResultPage.java
|
||||
|
||||
2004-04-20 Alain Magloire
|
||||
|
||||
In Eclipse-3.0 things changes to set partition scanner
|
||||
|
|
|
@ -84,7 +84,8 @@ public class CSearchResultPage extends AbstractTextSearchViewPage {
|
|||
* @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
|
||||
*/
|
||||
protected void clear() {
|
||||
// TODO Auto-generated method stub
|
||||
if (_contentProvider!=null)
|
||||
_contentProvider.clear();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
|
||||
|
|
Loading…
Add table
Reference in a new issue