What autogen.sh for an alternative ContentProvider for dav:// scheme?

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Thu Aug 27 10:34:31 PDT 2015


On 08/27/2015 03:37 PM, Stephan Bergmann wrote:
> On 08/27/2015 03:27 PM, Giuseppe Castagno wrote:
>> On 08/27/2015 01:37 PM, Stephan Bergmann wrote:
>>> On 08/27/2015 12:35 PM, Giuseppe Castagno wrote:
>>>> Saw commit [1], probably INetProtocol needs adjusting too.
>>>
>>> Don't think so.  Since INetURLObject falls back to INetProtocol::Generic
>>> now, there's rarely need these days to keep adding schemes to
>>> INetURLObject/INetProtocol.  (For example, "dav" and "davs" are not
>>> there, either.)
>>
>> Then, while checking for the scheme of a url to determine if it's webdav
>> or not, in SfxMedium::LockOrigFileOnDemand and SfxMedium::UnlockFile I
>> used:
>>
>> INetProtocol aProto =  GetURLObject().GetProtocol();
>> if( aProto ==  INetProtocol::Http || aProto ==  INetProtocol::Https ||
>> aProto ==  INetProtocol::VndSunStarWebdav )
>> {
>> // WebDAV !
>> }
>>
>> Or is there another way to detect the protocol ?
>
> Yeah, only after pressing "send" I understood that your "probably
> INetProtocol needs adjusting too" was meant in the context of your
> pending <https://gerrit.libreoffice.org/#/c/17189>.
>
> See <https://gerrit.libreoffice.org/#/c/18060/> for tentative new
> functionality to allow to easily check also for an
> INetProtocol::Generic's INetURLObject scheme.  And feel free to push in
> combination with your 17189 if it proves useful for your needs.

worked like a charm! Thanks Stephan, I'll add it to my patch set list, 
that will became three patch long, yours the first.

I wonder if in INetURLObject I can put a single method  like this:

bool INetURLObject::IsWebDAV()
{
	return ( hasScheme( "http" ) ||
           hasScheme( "https" ) ||
           hasScheme( "vnd.sun.start.webdav" ) ||
           hasScheme( "vnd.sun.start.webdavs" ) );
}

to have this test in a single place? Currently I repeat it four times.

Finally, looking at the code in INetURLObject I noticed this comment:
http://opengrok.libreoffice.org/xref/core/tools/source/fsys/urlobj.cxx#114

and this chunk of code:
http://opengrok.libreoffice.org/xref/core/tools/source/fsys/urlobj.cxx#335

should vnd.sun.star.webdavs be added as well?

> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice


-- 
Kind Regards,
Giuseppe Castagno
Acca Esse http://www.acca-esse.eu
giuseppe.castagno at acca-esse.eu


More information about the LibreOffice mailing list