mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-31 20:23:26 +02:00
[255390] don't assume one update means the search is done
This commit is contained in:
parent
91d6e55fa1
commit
377604c842
1 changed files with 31 additions and 18 deletions
|
@ -18,6 +18,7 @@
|
||||||
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup
|
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup
|
||||||
* David McKnight (IBM) - [214378] don't mark as finished until we have the results - sleep instead of wait
|
* David McKnight (IBM) - [214378] don't mark as finished until we have the results - sleep instead of wait
|
||||||
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
|
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
|
||||||
|
* David McKnight (IBM) - [255390] don't assume one update means the search is done
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.dstore.search;
|
package org.eclipse.rse.internal.services.dstore.search;
|
||||||
|
@ -91,27 +92,39 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
getStatusMonitor(ds).waitForUpdate(status, monitor);
|
boolean working = true;
|
||||||
String statusStr = status.getName();
|
while (working){
|
||||||
if (statusStr.equals("done")) //$NON-NLS-1$
|
getStatusMonitor(ds).waitForUpdate(status, monitor);
|
||||||
{
|
String statusStr = status.getName();
|
||||||
if (status.getNestedSize() > 0){
|
if (statusStr.equals("done")) //$NON-NLS-1$
|
||||||
config.setStatus(IHostSearchConstants.FINISHED);
|
{
|
||||||
}
|
if (status.getNestedSize() > 0){
|
||||||
else { // need to wait until we have all results on client
|
config.setStatus(IHostSearchConstants.FINISHED);
|
||||||
try
|
|
||||||
{
|
|
||||||
Thread.sleep(2000);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
else { // need to wait until we have all results on client
|
||||||
{
|
try
|
||||||
|
{
|
||||||
|
Thread.sleep(2000);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
config.setStatus(IHostSearchConstants.FINISHED);
|
||||||
|
}
|
||||||
|
working = false;
|
||||||
|
}
|
||||||
|
else if (statusStr.equals("cancelled")) //$NON-NLS-1$
|
||||||
|
{
|
||||||
|
config.setStatus(IHostSearchConstants.CANCELLED);
|
||||||
|
working = false;
|
||||||
|
}
|
||||||
|
else if (statusStr.equals("working")){ //$NON-NLS-1$
|
||||||
|
// still searching
|
||||||
|
if (monitor.isCanceled()){
|
||||||
|
config.setStatus(IHostSearchConstants.CANCELLED);
|
||||||
|
working = false;
|
||||||
}
|
}
|
||||||
config.setStatus(IHostSearchConstants.FINISHED);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (statusStr.equals("cancelled")) //$NON-NLS-1$
|
|
||||||
{
|
|
||||||
config.setStatus(IHostSearchConstants.CANCELLED);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue