Re: [Nautilus-list] Creating Launchers with Nautilus. Potensial patch.



On Sun, 3 Mar 2002, Gaute Lindkvist wrote:

> > > It fails when trying to write to any
> > > directory under Applications:///, with the error:
> > > Error writing file 'applications:///Internet/No name': Invalid URI
> >
> > Hmmm. Maybe there is an issue with the applications: method. Can you write
> > to other URIs?
> 
> I can write to trash and of course file://. But preferences:/// work
> exactly the same as
> applications. You can try this out yourself, because copying any file
> from any other directory to these URIs will result in the same error.
> The fix should probably make sure both things work correctly.
> 
> > Is applications: the vfolder method btw? If so, i can sort of see writing
> > there being "hard".
> >
> 
> I don't really know. I'm not very experienced in either C or Gnome, but
> have recently started trying to help around with some Nautilus coding,
> since I think this is a pretty good way of learning it.
> Even if it is vfolders, the gnome_desktop_item_save, should probably
> abstract this away, and let you write directly to these URIs, or there
> should be a new call, like Havoc suggested.

Both applications: and preferences: are handled by the vfolder gnome-vfs 
method. As can be seen in 
$prefix/etc/gnome-vfs-2.0/modules/default-modules.conf 

The vfolder module basically takes a bunch of directories with .desktop 
files, and generates a "virtual" filesystem hierarchy from the keywords 
specified in the desktop files and a vfolder specification.
See $prefix/etc/gnome-vfs-2.0/vfolders/applications.vfolder-info and
$prefix//etc/gnome-vfs-2.0/vfolders/preferences.vfolder-info for examples 
of how this is done.

Writing into vfolders is quite complicated, since it is not at all 
specified where the result will be stored, and what will happen to the 
file. E.g. If you store it in applications///Applications/Programming, 
will the desktop file magically get the Application and Development 
keywords?

Basically, you have to write the file somewhere else, and make sure that 
the vfolder specifications pick up the directory you write to.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a world-famous native American farmboy who knows the secret of the alien 
invasion. She's a strong-willed Buddhist cab driver with a knack for trouble. 
They fight crime! 





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