mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
Bug 378696 - Remove dead search code (step 2). r=timeless, sr=neil
This commit is contained in:
parent
19e2b71a02
commit
82fd0b3b08
@ -1,112 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<search
|
||||
title="Find Files"
|
||||
xmlns="http://www.mozilla.org/inspector/isml"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<dialog elements="txfSearchPath,txfSearchFor,cbRecurse"
|
||||
href="chrome://inspector/content/search/modules/findFiles/dialog.xul"/>
|
||||
|
||||
<columns delimiter="">
|
||||
<column title="File" name="path" flex="1" copy="true"/>
|
||||
</columns>
|
||||
|
||||
<implementation>
|
||||
|
||||
<property name="progressPercent">
|
||||
<getter><![CDATA[
|
||||
return (100 * (this.mFileSearch.directoriesSearched+1)) / this.mDirDepth;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<property name="progressText">
|
||||
<getter><![CDATA[
|
||||
return "blah";
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<property name="isPastMilestone">
|
||||
<getter><![CDATA[
|
||||
if (this.mDirDepth = 1) return true; // always update on a single dir search
|
||||
|
||||
var search = this.mFileSearch.directoriesSearched;
|
||||
var is = search > this.mDirsSearched;
|
||||
if (is)
|
||||
this.mDirsSearched = search;
|
||||
|
||||
return is;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<method name="searchStart">
|
||||
<parameter name="aMap"/>
|
||||
<body><![CDATA[
|
||||
if (!aMap.txfSearchPath) return false;
|
||||
|
||||
var fsearch = inSearchUtils.createSearchHelper("file");
|
||||
this.mFileSearch = fsearch;
|
||||
|
||||
var root = inSearchUtils.createLocalFile(aMap.txfSearchPath);
|
||||
|
||||
fsearch.searchPath = root;
|
||||
fsearch.filenameCriteria = aMap.txfSearchFor ? aMap.txfSearchFor : "*";
|
||||
fsearch.holdResults = false;
|
||||
fsearch.basePath = aMap.txfSearchPath;
|
||||
fsearch.returnRelativePaths = true;
|
||||
fsearch.searchRecursive = aMap.cbRecurse;
|
||||
|
||||
this.mDirDepth = fsearch.getDirectoryDepth(root);
|
||||
|
||||
var observer = inSearchUtils.createSearchObserver(this, "File");
|
||||
fsearch.searchAsync(observer);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="searchStop">
|
||||
<body><![CDATA[
|
||||
if (this.mFileSearch)
|
||||
this.mFileSearch.searchStop();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="returnSearchResult">
|
||||
<parameter name="aPath"/>
|
||||
<body><![CDATA[
|
||||
this.module.setResultProperty("path", aPath);
|
||||
this.module.searchResultReady();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!-- FileSearch observer -->
|
||||
|
||||
<method name="onFileSearchStart">
|
||||
<parameter name="aProcess"/>
|
||||
<body/>
|
||||
</method>
|
||||
|
||||
<method name="onFileSearchResult">
|
||||
<parameter name="aProcess"/>
|
||||
<body><![CDATA[
|
||||
var idx = aProcess.resultCount-1;
|
||||
this.returnSearchResult(aProcess.getStringResultAt(idx));
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="onFileSearchEnd">
|
||||
<parameter name="aProcess"/>
|
||||
<parameter name="aResult"/>
|
||||
<body><![CDATA[
|
||||
this.module.searchEnd();
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="onFileSearchError">
|
||||
<parameter name="aProcess"/>
|
||||
<parameter name="aMsg"/>
|
||||
<body/>
|
||||
</method>
|
||||
|
||||
</implementation>
|
||||
|
||||
</search>
|
Loading…
Reference in New Issue
Block a user