Comment 10 for bug 400830

Revision history for this message
John Baptist (jepst79) wrote :

I'm not sure you can solve this by extending the Nautilus plugin interface. For example, what if the file is deleted by another tool (e.g. rm)? Then Nautilus would have no idea about it, nevertheless nautilus-share should still consider the file un-shared.

Here's my idea (please keep in mind that I'm a newbie here and don't know anything about the internals of Nautilus, GNOME, or nautilus-share other than what I've read here, so I apologize if this is nonsense):

Right now, nautilus-share keeps track of which files are shared by their path, I think; that's what gives rise to the current bug, when two different files have, at different times, the same path. What if instead of this, we had a hidden file inside each shared folder, say .nautilus-share-info, which contained some unique ID. All IDs corresponding to currently shared folders are kept in nautilus-share's configuration, ~/.config/nautilus-share or whatever. Nautilus looks in each folder, if it has a .nautilus-share-info, it pulls up the corresponding line from its config and sets up shares accordingly. So, if you delete the folder, you delete the hidden file, too, and no other folder will have the same ID.