[Pkg-mozext-commits] [nostalgy] 08/15: Cleanup.

Guido Guenther agx at moszumanska.debian.org
Mon Jul 14 11:15:43 UTC 2014


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to annotated tag debian/0.2.32-1
in repository nostalgy.

commit ba44ed0ebedc0c8ec7d11e5159a4cce350c77150
Author: alain.frisch <alain.frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Mon Dec 16 10:48:53 2013 +0000

    Cleanup.
    
    git-svn-id: svn://frisch.fr/nostalgy/trunk@227 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
 content/folders.js | 118 ++++++++++++++++++++++++++---------------------------
 1 file changed, 57 insertions(+), 61 deletions(-)

diff --git a/content/folders.js b/content/folders.js
index 66292c5..721b3b6 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -140,67 +140,65 @@ function NostalgyAutocomplete(box) {
 }
 
 NostalgyAutocomplete.prototype.onStartLookup =
-function(text, results, listener) {
- var items = this.xresults.items;
- var nb = 0;
- items.Clear();
-
- var add_folder = function (fname) {
-  var newitem =
-   Components.classes[
-    "@mozilla.org/autocomplete/item;1"
-   ].createInstance(Components.interfaces.nsIAutoCompleteItem);
-  newitem.value = NostalgyCrop(fname);
-
-  items.AppendElement(newitem);
-  nb++;
- };
-
- var f = function (folder) { add_folder(NostalgyFolderName(folder)); };
-
- if (text == "") {
-	 var added_count=0;
-	if ( nostalgy_completion_options.use_statistical_prediction )
-	{
-		var predictedFolders = null;
-		try { predictedFolders = NostalgyPredict.predict_folder(nostalgy_recent_folders_max_size); }
-		catch (ex) { }
-		if( predictedFolders != null && predictedFolders.length > 0 )
-			for( var j = 0; j < predictedFolders.length; j++ )
-				if ( added_count < nostalgy_recent_folders_max_size )
-				{
-					f(predictedFolders[j]);
-					added_count++;
-				}
-	}
-	for ( j = 0; j < nostalgy_recent_folders.length; j++)
-	{
-		var found=0;
-		if ( nostalgy_completion_options.use_statistical_prediction && predictedFolders != null && predictedFolders.length > 0)
-			for( var i=0; i < predictedFolders.length; i++ )
-				if (NostalgyFolderName(predictedFolders[i]) == nostalgy_recent_folders[j] )
-					found=1;
-		if ( found==0 && added_count < nostalgy_recent_folders_max_size )
-		{
-			add_folder(nostalgy_recent_folders[j]);
-			added_count++;
-		}
+  function(text, results, listener) {
+    var items = this.xresults.items;
+    var nb = 0;
+    items.Clear();
+
+    var add_folder = function (fname) {
+      var newitem =
+        Components.classes[
+          "@mozilla.org/autocomplete/item;1"
+        ].createInstance(Components.interfaces.nsIAutoCompleteItem);
+      newitem.value = NostalgyCrop(fname);
+
+      items.AppendElement(newitem);
+      nb++;
+    };
+
+    var f = function (folder) { add_folder(NostalgyFolderName(folder)); };
+
+    if (text == "") {
+      var added_count=0;
+      var predictedFolders = null;
+      if ( nostalgy_completion_options.use_statistical_prediction )
+      {
+        try { predictedFolders = NostalgyPredict.predict_folder(nostalgy_recent_folders_max_size); }
+        catch (ex) { }
+        if( predictedFolders != null && predictedFolders.length > 0 )
+	  for (var j = 0; j < predictedFolders.length; j++)
+	    if (added_count < nostalgy_recent_folders_max_size) {
+	      f(predictedFolders[j]);
+	      added_count++;
+            }
+      }
+      for (var j = 0; j < nostalgy_recent_folders.length; j++) {
+	var found=0;
+	if (nostalgy_completion_options.use_statistical_prediction &&
+            predictedFolders != null && predictedFolders.length > 0)
+	  for (var i=0; i < predictedFolders.length; i++)
+	    if (NostalgyFolderName(predictedFolders[i]) == nostalgy_recent_folders[j] )
+	      found=1;
+	if ( found==0 && added_count < nostalgy_recent_folders_max_size ) {
+	  add_folder(nostalgy_recent_folders[j]);
+	  added_count++;
 	}
- } else {
-   nostalgy_search_folder_options.do_tags =
-     nostalgy_completion_options.always_include_tags ||
-     (text.substr(0,1) == ":");
-   NostalgyIterateMatches(text, this.box.shell_completion, f);
-   if (nb == 0 && !nostalgy_search_folder_options.do_tags) {
-     nostalgy_search_folder_options.do_tags = true;
-     NostalgyIterateMatches(text, this.box.shell_completion, f);
-   }
- }
+      }
+    } else {
+      nostalgy_search_folder_options.do_tags =
+        nostalgy_completion_options.always_include_tags ||
+        (text.substr(0,1) == ":");
+      NostalgyIterateMatches(text, this.box.shell_completion, f);
+      if (nb == 0 && !nostalgy_search_folder_options.do_tags) {
+        nostalgy_search_folder_options.do_tags = true;
+        NostalgyIterateMatches(text, this.box.shell_completion, f);
+      }
+    }
 
- this.xresults.searchString = text;
- this.xresults.defaultItemIndex = 0;
- listener.onAutoComplete(this.xresults, 1);
-}
+    this.xresults.searchString = text;
+    this.xresults.defaultItemIndex = 0;
+    listener.onAutoComplete(this.xresults, 1);
+  };
 
 NostalgyAutocomplete.prototype.onStopLookup =
   function() {  };
@@ -221,10 +219,8 @@ function NostalgyStartLookup() {
     this.isSearching = true;
     this.mFirstReturn = true;
     this.mSessionReturns = this.sessionCount;
-    this.mFailureCount = 0; // For TB 2.0
     this.mFailureItems = 0;
     this.mDefaultMatchFilled = false; // clear out our prefill state.
-    this.removeAttribute("noMatchesFound"); // For TB 2.0
 
     // tell each session to start searching...
     for (var name in this.mSessions)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git



More information about the Pkg-mozext-commits mailing list