[Geany-devel] Opening unmounted GIO URIs

Lex Trotman elextr at xxxxx
Tue Jan 31 01:04:58 UTC 2012


On Tue, Jan 31, 2012 at 11:30 AM, Colomban Wendling
<lists.ban at herbesfolles.org> wrote:
> Hey Nick, Matthew, Lex, Frank, Enrico, whoever cares,
>
> https://github.com/b4n/geany/commit/01fd682674286dada6d6b77d0e3064c89a28df64
>
> I wrote this patch that adds automatic mounting of volumes needed to
> open a GIO URI, so one don't have to first mount the corresponding
> volume in Nautilus/whatever.  This make opening arbitrary URIs from the
> CLI easier, though it's probably not needed when using a file manager
> (who would've already mounted the volume to browse it).
>
> I'm quite confident mounting the volume is a good idea in theory, but
> there is a small thing making it a bit tricky: GIO doesn't seem to
> provide a synchronous API to do that.

My only problem with making uri operations easier is that the
incidence of remote data loss or performance complaints will increase.

>
> So, it either requires the calling code to be asynchronous (which we
> don't have yet and that don't fit well with current code), or to hack
> around to make the asynchronous code look synchronous.
>
> I did the latter, and that's basically the reason why I post this mail:
>  do you think it's too ugly, too useless, too something?

Well, shrug, what else can you do?

But if the mainloop is still running while waiting, does that mean the
UI is still available and the user can trigger another open? Will that
work since AFAIK none of Geany is intended to be re-entrant.

Its a pity our old friend g_replace_contents doesn't work safely,
otherwise we could g_file_new_from_uri, g_file_read to read it and
g_file_replace_contents to write it, and let GIO do what it is meant
to, sigh.

>
> Basically, points I see in a pros/cons:
>
> + allows to open URIs on unmounted volumes;
> + as a cause, makes Geany handle URIs more naturally;
> + mount is tried only as a last resort, so doesn't impact already
> working situations;
>
> - code is a bit hackish (the loop thing), though it works fine [1];
> - may be slow if mounting the volume is slow (since it is synchronous);
> - may not be really useful in practice (since people probably open URI
> through the file manager, who will mount the volume).
>

Well I can't comment on its utility since I never edit anything
remotely anyway. (but I guess that was a comment anyway).


Cheers
Lex

>
> So... thoughts?
>
>
> Cheers,
> Colomban
>
>
> [1] only problem might be that idle/timeout callbacks (e.g. main loop
> sources) can still run during the mount -- though, I don't see why it'd
> be an actual problem for us

See question above

> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel



More information about the Devel mailing list