summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/projectexplorer.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@nokia.com>2012-05-04 11:49:37 +0200
committerDaniel Teske <daniel.teske@nokia.com>2012-05-08 13:12:17 +0200
commite8ee898864dee2b7e7fef7656ea030ab9d85332b (patch)
tree0d2d7516f22af58319315f1d090519a0c9fc9ff3 /src/plugins/projectexplorer/projectexplorer.cpp
parent3b4c6c0332c65d48afae8b8917d01067698a22f7 (diff)
downloadqt-creator-e8ee898864dee2b7e7fef7656ea030ab9d85332b.tar.gz
ProjectExplorer: Remove hack for virtual folders
Previously virtual folders, that is the "Sources", "Headers" folders used a hack. This patch removes that hack, by introducing the following changes - The FlatModel and the ProjectExplorer::Nodes now don't require path() to be unique. Thus allowing the virtual folders to all return the same for path(). [1] - Introducing a new node type "VirtualFolder" which is sorted according to a priority. - Introducing a few new virtuals for displayName and toolip(), which can be overriden. [1] Note that all the project managers do require path() to be unique for some types of nodes. That also fixes: Task-number: QTCREATORBUG-7100 Change-Id: I76b730f4c4254e2894467603bbe9a30e356a0bcc Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/projectexplorer.cpp')
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index a4f4553b05..92f46f15e1 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -2567,12 +2567,11 @@ QString pathOrDirectoryFor(Node *node, bool dir)
QString path = node->path();
QString location;
FolderNode *folder = qobject_cast<FolderNode *>(node);
- const int hashPos = path.indexOf(QLatin1Char('#'));
- if (hashPos >= 0 && folder) {
+ if (node->nodeType() == ProjectExplorer::VirtualFolderNodeType && folder) {
// Virtual Folder case
// If there are files directly below or no subfolders, take the folder path
if (!folder->fileNodes().isEmpty() || folder->subFolderNodes().isEmpty()) {
- location = path.left(hashPos);
+ location = path;
} else {
// Otherwise we figure out a commonPath from the subfolders
QStringList list;