Code review comment for lp:~aacid/unity8/decodeAudioURIs

Revision history for this message
James Henstridge (jamesh) wrote :

Perhaps the following algorithm would handle the majority of cases as a normalisation algorithm:

1. Check the URI scheme. If it isn't "file", then the original URI is the normalised URI.
2. Otherwise, convert to a local file name with QUrl::toLocalFile
3. Optionally try to canonicalise the file name (this might not be needed).
4. Convert that filename to the normalised URI with QUrl::fromLocalFile

That won't help with HTTP URIs, but should ensure that file URIs for the same path are identical.

I'm not sure you can do all this from QML, so it might need to be implemented in C++ then exposed.

« Back to merge proposal