1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 21:15:23 +02:00

[214378] [dstore] remote search doesn't display results sometimes

This commit is contained in:
David McKnight 2008-01-04 18:35:28 +00:00
parent 4692095642
commit 72d794af7a
3 changed files with 35 additions and 16 deletions

View file

@ -15,6 +15,7 @@
* Michael Berger (IBM) - Bug 147791 - symbolic links can cause circular search. * Michael Berger (IBM) - Bug 147791 - symbolic links can cause circular search.
* David McKnight (IBM) - [190010] cancelling search * David McKnight (IBM) - [190010] cancelling search
* Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread * Xuan Chen (IBM) - [160775] [api] rename (at least within a zip) blocks UI thread
* David McKnight (IBM) - [214378] canonical path not required - problem is in the client
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -133,8 +134,9 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
// to status refresh. As a result client thinks // to status refresh. As a result client thinks
// search isn't finished. // search isn't finished.
// _miner.statusDone(_status); // _miner.statusDone(_status);
_status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$ _status.setAttribute(DE.A_NAME, "done"); //$NON-NLS-1$
_dataStore.refresh(_status, true); // true indicates refresh immediately _dataStore.refresh(_status, true); // true indicates refresh immediately
} }
} }
@ -171,16 +173,8 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
// is it an archive? // is it an archive?
boolean isArchive = ArchiveHandlerManager.getInstance().isArchive(theFile); boolean isArchive = ArchiveHandlerManager.getInstance().isArchive(theFile);
// use canonical path since sometimes we have symbolic links String absPath = absPath = theFile.getAbsolutePath();
String absPath = null;
try
{
absPath = theFile.getCanonicalPath();
}
catch (Exception e)
{
absPath = theFile.getAbsolutePath();
}
String compareStr = theFile.getName(); String compareStr = theFile.getName();
@ -247,7 +241,6 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
} }
// otherwise, search the file // otherwise, search the file
else { else {
if (!isArchive) { if (!isArchive) {
deObj = _dataStore.createObject(null, _deFile, compareStr); deObj = _dataStore.createObject(null, _deFile, compareStr);
} }
@ -343,7 +336,6 @@ public class UniversalSearchHandler extends Thread implements ICancellableHandle
} }
protected boolean internalSearchWithinFile(DataElement remoteFile, String absPath, File theFile) { protected boolean internalSearchWithinFile(DataElement remoteFile, String absPath, File theFile) {
// if search string is empty, no need to look for matches within file // if search string is empty, no need to look for matches within file
if (_isFileSearch) { if (_isFileSearch) {
return true; return true;

View file

@ -14,6 +14,7 @@
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * {Name} (company) - description of contribution.
* David McKnight (IBM) [190010] commented why we don't need status monitor * David McKnight (IBM) [190010] commented why we don't need status monitor
* David McKnight (IBM) - [214378] [dstore] remote search doesn't display results sometimes
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.services.dstore.search; package org.eclipse.rse.internal.services.dstore.search;
@ -38,7 +39,7 @@ public abstract class DStoreSearchResultConfiguration extends AbstractSearchResu
{ {
_status = status; _status = status;
// no need for a domain listner because we check the status via status monitor // no need for a domain listner because we check the status via status monitor
// _status.getDataStore().getDomainNotifier().addDomainListener(this); _status.getDataStore().getDomainNotifier().addDomainListener(this);
} }
public DataElement getStatusObject() public DataElement getStatusObject()

View file

@ -17,6 +17,7 @@
* Kevin Doyle (IBM) - [190010] Added cancel() method that will call the search service to cancel * Kevin Doyle (IBM) - [190010] Added cancel() method that will call the search service to cancel
* David McKnight (IBM) - [190010] performance improvement to use caching for dstore search * David McKnight (IBM) - [190010] performance improvement to use caching for dstore search
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
* David McKnight (IBM) - [214378] [dstore] remote search doesn't display results sometimes
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.subsystems.files.dstore; package org.eclipse.rse.internal.subsystems.files.dstore;
@ -167,8 +168,10 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe
if (_status.getValue().equals("done")) //$NON-NLS-1$ if (_status.getValue().equals("done")) //$NON-NLS-1$
{ {
setStatus(IHostSearchConstants.FINISHED); setStatus(IHostSearchConstants.FINISHED);
// need to wait for the results though
_status.getDataStore().getDomainNotifier().removeDomainListener(this); DelayedDomainListenerRemover remover = new DelayedDomainListenerRemover(this, _status);
remover.start();
// _status.getDataStore().getDomainNotifier().removeDomainListener(this);
} }
else if (_status.getValue().equals("cancelled")) //$NON-NLS-1$ else if (_status.getValue().equals("cancelled")) //$NON-NLS-1$
{ {
@ -186,4 +189,27 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe
getSearchService().cancelSearch(this, new NullProgressMonitor()); getSearchService().cancelSearch(this, new NullProgressMonitor());
} }
} }
private class DelayedDomainListenerRemover extends Thread
{
private DStoreFileSubSystemSearchResultConfiguration _config;
private DataElement _status;
public DelayedDomainListenerRemover(DStoreFileSubSystemSearchResultConfiguration config, DataElement status)
{
_status = status;
_config = config;
}
public void run()
{
try
{
sleep(1000);
}
catch (Exception e)
{
}
_status.getDataStore().getDomainNotifier().removeDomainListener(_config);
}
}
} }