[KF5 Port] To the seniors: Path of directories

Olivier Churlaud olivier at churlaud.com
Sat Nov 21 14:08:38 UTC 2015


Hi,

As I said before, the folder scan has a problem. To solve it, I needed 
to do

src/core-impl/collections/db/sql/SqlScqnResultProcessor.cpp:401
-        if( !m_foundDirectories.contains( path ) )
+       if( !m_foundDirectories.contains( path +'/' ) )

This is dirty. I tracked the origin of this, and it appears that in the 
CollectionScanner, we check if the directory ends by '/' and if not we 
add it. I guess this is done to easily add the filenames at the end. 
/First question: is it true?/

I think the problem comes from changing KUrl to QUrl. QUrl::path() as no 
trailing slash by default it seems whereas KUrl had it.

So how to solve this? Three options:
1) Use my dirty hack given above
2) Change the CollectionScanner to remove the trailing slash
3) Change  src/core-impl/collections/db/MountPointManager.cpp so that we 
add a trailing slash add the end (check that it's a directory, if no 
trailing slash, add one) in line 235 I would say.

Please tell me what solution is better, else I'll try the 3rd one and 
see what happens.

Cheers
Olivier

-- 
Olivier CHURLAUD
Engineer Student at Ecole Centrale de Lyon
in Dual Degree at TU Berlin, M.Sc. Elektrotechnik
@: olivier at churlaud.com
tel: +49 (0)1575-2931348
in:  http://linkedin.com/in/olivierchurlaud
web: http://olivier.churlaud.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20151121/d8abfacf/attachment.html>


More information about the Amarok-devel mailing list