Commit 187c322d authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

fix invalid cast

parent 4e91ad94
......@@ -43,10 +43,11 @@ QUrl File::url(const Folder *root) const
{
QString path;
if (root == this)
if (root == this) {
root = nullptr; //prevent returning empty string when there is something we could return
}
for (const Folder *d = (Folder*)this; d != root && d; d = d->parent()) {
for (const File *d = this; d != root && d; d = d->parent()) {
path.prepend(QFile::decodeName(d->name8Bit()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment