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
|
2004-04-12 Bogdan Gheorghe
|
||||||
Added Indexer watchdog
|
Added Indexer watchdog
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,10 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
||||||
public void addSource(IFile resource, IPath indexedContainer){
|
public void addSource(IFile resource, IPath indexedContainer){
|
||||||
if (CCorePlugin.getDefault() == null) return;
|
if (CCorePlugin.getDefault() == null) return;
|
||||||
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
|
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
|
||||||
|
|
||||||
|
if (!jobSet.add(job.resource.getLocation()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
|
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
|
||||||
// reduces the chance that the file is open later on, preventing it from being deleted
|
// reduces the chance that the file is open later on, preventing it from being deleted
|
||||||
if (!job.initializeContents()) return;
|
if (!job.initializeContents()) return;
|
||||||
|
@ -595,5 +599,16 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
||||||
public TimeOut getTimeout() {
|
public TimeOut getTimeout() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return this.timeoutThread ;
|
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;
|
package org.eclipse.cdt.internal.core.search.processing;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import org.eclipse.cdt.core.ICLogConstants;
|
import org.eclipse.cdt.core.ICLogConstants;
|
||||||
import org.eclipse.cdt.internal.core.Util;
|
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.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.OperationCanceledException;
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
|
@ -38,7 +40,8 @@ public abstract class JobManager implements Runnable {
|
||||||
public boolean activated = false;
|
public boolean activated = false;
|
||||||
|
|
||||||
private int awaitingClients = 0;
|
private int awaitingClients = 0;
|
||||||
|
|
||||||
|
protected HashSet jobSet = new HashSet();
|
||||||
public static void verbose(String log) {
|
public static void verbose(String log) {
|
||||||
System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$
|
System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
@ -320,6 +323,11 @@ public abstract class JobManager implements Runnable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IndexRequest tempJob = null;
|
||||||
|
if (job instanceof IndexRequest)
|
||||||
|
tempJob = (IndexRequest) job;
|
||||||
|
|
||||||
|
|
||||||
// append the job to the list of ones to process later on
|
// append the job to the list of ones to process later on
|
||||||
int size = awaitingJobs.length;
|
int size = awaitingJobs.length;
|
||||||
if (++jobEnd == size) { // when growing, relocate jobs starting at position 0
|
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);
|
//if (status == FAILED) request(job);
|
||||||
} finally {
|
} finally {
|
||||||
executing = false;
|
executing = false;
|
||||||
|
jobFinishedNotification(currentJob());
|
||||||
if (VERBOSE) {
|
if (VERBOSE) {
|
||||||
JobManager.verbose("FINISHED background job - " + job); //$NON-NLS-1$
|
JobManager.verbose("FINISHED background job - " + job); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -447,5 +456,7 @@ public abstract class JobManager implements Runnable {
|
||||||
}
|
}
|
||||||
return buffer.toString();
|
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
|
2004-04-20 Alain Magloire
|
||||||
|
|
||||||
In Eclipse-3.0 things changes to set partition scanner
|
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()
|
* @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
|
||||||
*/
|
*/
|
||||||
protected void clear() {
|
protected void clear() {
|
||||||
// TODO Auto-generated method stub
|
if (_contentProvider!=null)
|
||||||
|
_contentProvider.clear();
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
|
* @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue