[gimp/tito: 34/50] Fuzzy! High speed titoing now.



commit 8a0880ef4acbca05374857d29640bd2e809f8144
Author: Srihari Sriraman <srihari c42 in>
Date:   Sun Sep 9 15:07:15 2012 +0530

    Fuzzy! High speed titoing now.

 app/dialogs/tito-dialog.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/app/dialogs/tito-dialog.c b/app/dialogs/tito-dialog.c
index 0cc1d41..4b0f2b1 100644
--- a/app/dialogs/tito-dialog.c
+++ b/app/dialogs/tito-dialog.c
@@ -561,12 +561,13 @@ fuzzy_search ( gchar *string,
                gchar *key)
 {
   gchar *remaining_string = string;
-  if ( strlen(key) == 0 || strlen(remaining_string) == 0 )
+  if ( strlen(key) == 0 )
       return TRUE;
 
   if ( (remaining_string = strchr(string, key[0])) != NULL )
-      fuzzy_search( key+1, remaining_string+1 );
-  return FALSE;
+      return fuzzy_search( remaining_string+1, key+1 );
+  else
+    return FALSE;
 }
 
 static gboolean
@@ -599,9 +600,10 @@ tito_is_action_match ( GtkAction *action,
     }
 
   if(strstr(label,key))
-        return TRUE;
-  // if(fuzzy_search(label,key))
-  //       return TRUE;
+    return TRUE;
+
+  if(fuzzy_search(label,key))
+    return TRUE;
 
   if(strlen(key)>2 || strcmp(key," ")==0)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]