Commit 0ae75355 authored by Daniel Teske's avatar Daniel Teske

ProjectTree; Fix directoryFor() to handle new resource nodes

The resource nodes do have a special path, the code assumed that
folder's path were always directories. This is no longer true.

Both pathFor() and directoryFor() suffer from path() being special for
VirtualFolderNodes and ResourceNodes. That specialness is probably not
a good idea, cleaning that up is a longer term task.

Task-number: QTCREATORBUG-11677
Change-Id: I995e82b7ed361b5e2c6681484074c65e2175c96e
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent e060086f
......@@ -2771,6 +2771,12 @@ QString pathOrDirectoryFor(Node *node, bool dir)
list << f->path() + QLatin1Char('/');
location = Utils::commonPath(list);
}
QFileInfo fi(location);
while ((!fi.exists() || !fi.isDir())
&& !fi.isRoot())
fi.setFile(fi.absolutePath());
location = fi.absoluteFilePath();
} else {
QFileInfo fi(path);
// remove any /suffixes, which e.g. ResourceNode uses
......
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