Re: [Nautilus-list] Nautilus using Text view instead of Mozilla view



Le 30 May 2001 10:48:05 -0700, Darin Adler a écrit :
> On Wednesday, May 30, 2001, at 10:19  AM, Frederic Crozat wrote:
> 
> > I've found where the problem is :
> >
> > when we fill the list with all the available oaf server which can handle
> > text/html mime-type, the order of the list is changed after each
> > insertion. Therefore, when there is no user defined component for
> > text/html, first element of resulting list is returned, which is not the
> > first element of the oaf response to the query.
> >
> > The following patch corrects the problem.
> >
> > Can I commit ?
> >
> > --- nautilus/libnautilus-private/nautilus-mime-actions.c.orig       Fri May 11
> > 03:30:31 2001
> > +++ nautilus/libnautilus-private/nautilus-mime-actions.c    Wed May 30
> > 19:13:13 2001
> > @@ -1632,7 +1632,7 @@
> >
> >     CORBA_free (oaf_result);
> >     
> > -   return g_list_reverse (retval);
> > +   return retval;
> >  }
> 
> Please don't commit this patch. This does the wrong thing. The reverse is 
> needed in that function nautilus_do_component_query, because the function 
> walks through the query results and prepends each one to the list. So the 
> list ends up in reverse order and must be reversed before returning.
> 
> Or maybe I am missing something?
> 
> My guess is that one of the callers has a mistake in its code. Could you 
> be more specific about which function was called and returned the wrong 
> MIME type?
> 
> You say that "the order of the list is changed after each insertion". Can 
> you point me at the code that changes the order of the list?

I was not enough specific. It is not the order of the list which is
changed but the start of the list :

from glib doc, 
g_list_append (used in Nautilus 1.0.3 and below) and 
g_list_prepend (used in CVS now) modify the start of the list 
"Note: The return value is the new start of the list, which may have
changed, so make sure you store the new value."

OAF answer for text/html is 
"nautilus_mozilla_content_view" and after "nautilus_text_view".

When we fill the servers list, g_list_prepend (or append) modify the
start of the list and nautilus_text_view become the start of the list
:((

In nautilus_mime_get_default_component_for_file_internal, if we use
default settings for text/html, the start of servers list is used 
(line 415 : server = OAF_ServerInfo_duplicate (info_list->data);)
and nautilus_text_view is used :((

Maybe the good solution would be to remember the initial start of
servers list and return it in nautilus_do_component_query .

-- 
Frédéric Crozat
MandrakeSoft





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