Re: Mini-Commander: Autocomplete




>> > I modified the mini-commander applet to use autocomplete.  Is this
>> > something that other people want?  Should I send my changes to the
>> > author? I've attached the file I changed. I modified it from
>> > gnome-core-1.0.9
>>
>> It is a nice feature.  Could you provide this in a patch form?
>
>I once editted gnome-entry.c so it used autocomplete. I think it got
ignored
>the last time, or at least no-one ever commented on it, and it never
got
>added to the CVS.
>
>Was there any reason for this, or was I just unlucky that it got missed
in
>the midst of all the traffic?
>
>Iain
sorry didn't mean to steal your idea.

I found yet another bug in my small little change.  (Who woulda thought
there'd
be so many).  This one is pretty big; anyone with less than the maximum
entries
allowed in there history(50 I believe) will get a segfault when trying
to use
autocomplete.  This bug is because I thought HISTORY_DEPTH was something

different than it was and because I didn't know entries were added to
the history
db backwards.  I got the cvs version of mini-commander, fixed the bug
and diff'd
it(I think).  This is the first time I used diff, so I may not have done
it right.  If it
doesn't work for anyone who tries to use it, e-mail me and I will send
you the full
source file or the glibc 2.1 binary.


--
Halfline (Ray Strode)
90c90
< 	}
---
>                  }
475,484c475,486
<     sprintf(currentCommand, "%s%s", gtk_entry_get_text(GTK_ENTRY(widget)), event->string);
<     
<     for(i = 0; i < HISTORY_DEPTH; i++)
< 	{
< 	    completedCommand = getHistoryEntry(i);
< 	    if(!g_strncasecmp(completedCommand, currentCommand, strlen( currentCommand)) )
< 		{
< 		    return completedCommand;
< 		}
< 	}
---
>     sprintf(currentCommand, "%s%s", gtk_entry_get_text(GTK_ENTRY(widget)), event->string); 
>     for(i = HISTORY_DEPTH - 1; i >= 0; i--) 
>  	{
> 	  g_print("Checking Entry %d \n", i);
>             if(!existsHistoryEntry(i)) break;
>  	    completedCommand = getHistoryEntry(i); 
>  	    if(!g_strncasecmp(completedCommand, currentCommand, strlen( currentCommand)) ) 
>  		{ 
>  		    return completedCommand; 
>  		} 
>  	} 
> 


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