checking that a wxFileSystem handler is registered
Francesco Montorsi
f18m_cpp217828 at yahoo.it
Mon Jul 10 02:09:25 PDT 2006
Vadim Zeitlin ha scritto:
> On Mon, 03 Jul 2006 14:08:39 +0200 Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:
>
> FM> BTW, also on this subject, I think that, since wxFileSystem uses the
> FM> list of handlers sequentially, it may be very useful to:
> FM>
> FM> 1) add an InsertHandler() function which just calls m_Handlers.Insert()
> FM> function
>
> Does it make sense to have 2 handlers for the same URI schema?
some times it could as I could create a custom handler which opens the
"http://mywebsite.com" and "http://mywebsite.net" URLs only in a special
way and leaves all others http:// addresses to handle to
wxInternetFSHandler.
I know this is a rare situation but it could still be useful for some
users ;)
> Do you just
> mean to use this as a way to temporarily override some handler (i.e. add a
> custom handler at the beginning of the list disabling the existing one and
> then remove the custom handler reenabling the old one) or do you see any
> other uses for this?
overriding some other handler is the only reason I can think to, now.
But the override could also be not a temporary override (see my example
above).
> BTW, another possibility would be to just make AddHandler() add the new
> handler in the beginning of the list because I think most (all?) of the
> time you want the last added handler to be the most prioritary one.
yes, I think this could be a good choice.
> FM> 2) rename AddHandler to AppendHandler().
>
> The Add/Append confusion is unfortunately quite wide spread in wx API :-(
>
> FM> 3) document that the handlers registered first have more priority over
> FM> the handlers registered later.
>
> Yes, we should definitely document how all this works, whatever we choose.
Ok - then let me know which function (Insert/AddHandler) should be
added/changed and I'll submit this small patch.
Thanks,
Francesco
More information about the wx-dev
mailing list