Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
e0a12e9e
Commit
e0a12e9e
authored
Feb 24, 2010
by
con
Browse files
Show native file paths in category sub-folder nodes.
Correctly show * Headers * C:\foo instead of * Headers * C:/foo
parent
00404240
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt4nodes.cpp
View file @
e0a12e9e
...
...
@@ -245,7 +245,7 @@ struct InternalNode
QMap
<
QString
,
InternalNode
*>
subnodes
;
QStringList
files
;
ProjectExplorer
::
FileType
type
;
QString
full
Name
;
QString
full
Path
;
QIcon
icon
;
InternalNode
()
...
...
@@ -269,6 +269,13 @@ struct InternalNode
// * file2
// * path2
// * file1
// The method first creates a tree that looks like the directory structure, i.e.
// * /
// * absolute
// * path
// ...
// and afterwards calls compress() which merges directory nodes with single children, i.e. to
// * /absolute/path
void
create
(
const
QString
&
projectDir
,
const
QStringList
&
newFilePaths
,
ProjectExplorer
::
FileType
type
)
{
static
const
QChar
separator
=
QChar
(
'/'
);
...
...
@@ -299,7 +306,7 @@ struct InternalNode
if
(
!
currentNode
->
subnodes
.
contains
(
key
))
{
InternalNode
*
val
=
new
InternalNode
;
val
->
type
=
type
;
val
->
full
Name
=
path
;
val
->
full
Path
=
path
;
currentNode
->
subnodes
.
insert
(
key
,
val
);
currentNode
=
val
;
}
else
{
...
...
@@ -317,7 +324,7 @@ struct InternalNode
// Removes folder nodes with only a single sub folder in it
void
compress
()
{
static
const
QChar
separator
=
Q
Char
(
'/'
);
static
const
QChar
separator
=
Q
Dir
::
separator
();
// it is used for the *keys* which will become display name
QMap
<
QString
,
InternalNode
*>
newSubnodes
;
QMapIterator
<
QString
,
InternalNode
*>
i
(
subnodes
);
while
(
i
.
hasNext
())
{
...
...
@@ -363,7 +370,7 @@ struct InternalNode
foldersToRemove
<<
*
existingNodeIter
;
++
existingNodeIter
;
}
else
if
((
*
existingNodeIter
)
->
displayName
()
>
newNodeIter
.
key
())
{
FolderNode
*
newNode
=
new
FolderNode
(
newNodeIter
.
value
()
->
full
Name
);
FolderNode
*
newNode
=
new
FolderNode
(
newNodeIter
.
value
()
->
full
Path
);
newNode
->
setDisplayName
(
newNodeIter
.
key
());
if
(
!
newNodeIter
.
value
()
->
icon
.
isNull
())
newNode
->
setIcon
(
newNodeIter
.
value
()
->
icon
);
...
...
@@ -382,7 +389,7 @@ struct InternalNode
++
existingNodeIter
;
}
while
(
newNodeIter
!=
subnodes
.
constEnd
())
{
FolderNode
*
newNode
=
new
FolderNode
(
newNodeIter
.
value
()
->
full
Name
);
FolderNode
*
newNode
=
new
FolderNode
(
newNodeIter
.
value
()
->
full
Path
);
newNode
->
setDisplayName
(
newNodeIter
.
key
());
if
(
!
newNodeIter
.
value
()
->
icon
.
isNull
())
newNode
->
setIcon
(
newNodeIter
.
value
()
->
icon
);
...
...
@@ -489,7 +496,7 @@ void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader)
InternalNode
*
subfolder
=
new
InternalNode
;
subfolder
->
type
=
type
;
subfolder
->
icon
=
fileTypes
.
at
(
i
).
icon
;
subfolder
->
full
Name
=
m_projectDir
+
'#'
+
fileTypes
.
at
(
i
).
typeName
;
subfolder
->
full
Path
=
m_projectDir
+
'#'
+
fileTypes
.
at
(
i
).
typeName
;
contents
.
subnodes
.
insert
(
fileTypes
.
at
(
i
).
typeName
,
subfolder
);
// create the hierarchy with subdirectories
subfolder
->
create
(
m_projectDir
,
newFilePaths
,
type
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment