Re: [Patch] parse correctly some .desktop file created for KDE



On Tue, 2006-04-25 at 12:04 +0200, Frederic Crozat wrote:
> Le mardi 25 avril 2006 à 11:41 +0200, Alexander Larsson a écrit :
> > On Thu, 2006-04-06 at 17:15 +0200, Frederic Crozat wrote:
> > > This patch (sorry, it is quite old but I didn't submitted for review on
> > > the mailing list) fixes parsing some keys in Exec fields for .desktop
> > > files which are KDE specific.
> > 
> > I'm a bit hesitant to this part:
> > 
> > +       /* URIs were not used, add first one as %f */
> > +       if (expanded && (uri_list == *uris)) {
> > +               g_string_append_c (expanded_exec, ' ');
> > +               expand_macro ('f', expanded_exec, application, uris);
> > +       }
> > 
> > If we expanded anything (like, say %i) but we didn't consume any uri
> > (i.e. there was no %u, %f or similar in the exec line) we then (and only
> > then) append an implicit %f at the end.
> > 
> > Why is this needed? If it is needed, why only when nothing was expanded?
> 
> The initial bug report was http://qa.mandriva.com/show_bug.cgi?id=15357
> 
> initially, the following Exec line wasn't handled properly as mime
> handler :
> Exec=kpdf %i %m -caption "%c"
> since no uri was appended (as file or uri), causing application to never
> be passed a file as argument (which is kind of pointless for a mime
> handler).
> 
> I added this "hack" to workaround this problem, using the most common
> parameter ie %f.
> 
> Since then, KDE has fixed this bug (at least in kpdf) and added %U, so
> we might drop this part of the patch, but it might cause problem with
> broken (ie missing %f/%F/%u/%U) .desktop file.

In that case we would want %f as the default even if there is no %i in
the file. I think we should just be anal with the desktop file spec and
get broken apps fixed. Please commit without that part.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an impetuous albino senator from the 'hood. She's a hard-bitten goth 
pearl diver with a song in her heart and a spring in her step. They fight 
crime! 




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