url or resourceUrl?
I hoped we are not going to have these problems after the death of Nepomuk. Thought file paths for files and urls for everything else would be a sane default. :)
Also, can you add a TODO: KF6 rething the function names for these two.
url makes more sense to me, no need to decorate it, this is idiomatic KDE/Qt. toUrl might make sense alternatively since it is not a free operation as it is a copy.
I am not too aware of the history around Nepomuk.
File paths for files and urls for everything else is fine internally but the API was not very clear about how to use it.
IMO we would need a type dedicated for file path, that would be a wrapper around QString, something like C++17 https://en.cppreference.com/w/cpp/filesystem/path or Rust https://doc.rust-lang.org/std/path/struct.Path.html
While we are at it I could add a isPath() or similar to tell if resource contains a url or a path QDir::isAbsolutePath(resource()) basically.
About KF6 I would suggest resource would return something like std::variant<std::filesystem::path, QString> https://en.cppreference.com/w/cpp/utility/variant
Just add TODO and you are free to push
Ok, agreed. The reason why I thought the resourceUrl is a better choice is that it is an url of the resource, not of the result. But I agree url is cleaner.
We'll see about the KF6 part. variants/optionals vs a proxy type that converts to QString and QUrl in a correct way :)