[vlc-devel] [PATCH 2/2] DnD from Internet Explorer to VLC and support of links (*.lnk)
Mario Speiß
1034-135 at online.de
Sat Jan 19 18:40:37 CET 2013
On 18.01.2013 23:29, Rémi Denis-Courmont wrote:
> Le vendredi 18 janvier 2013 19:42:08, Francois Cartegnie a écrit :
>> Le 06/01/2013 17:52, Mario Speiß a écrit :
>>> + QString mrl = toURI( url.toEncoded().constData() );
>>> + QVLCFileInfo info( url.toLocalFile() );
>>> + if( info.exists()&& info.isSymLink() )
>>> + {
>>> + QString target = info.symLinkTarget();
>>> + QUrl url;
>>> + if( QFile::exists( target ) )
>>> + url = QUrl::fromLocalFile( target );
>>> + mrl = toURI( url.toEncoded().constData() );
>>> + }
>>> + if( mrl.length()> 0 )
>>> + playlist_Add( THEPL, qtu(mrl), NULL,
>>
>> I don't see why you would resolve symlink on *nix systems.
>
> +1
>
>> Probably need to #ifdef win32 here.
>
> It's questionable on Windows too. Why should symbolic links work *only* in
> case of drag-and-drop?
>
If you "open" a .lnk using the builtin dialogs the .lnk are already
resolved to their targets *before* vlc code will add them to the
playlist. That is the reason for not needing to implement this in the
"file-open" environments.
For d&d-operations however, the .lnk are *not* resolved but handed over
to the vlc code. Thats why it is neccessary to resolve the links here
(and also in the playlist!). I think there might even be a ticket for
that problem but i dont find it.
I agree, one should put #ifdef around it.
Regards,
Mario
More information about the vlc-devel
mailing list