Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
cbfcf88f
Commit
cbfcf88f
authored
11 years ago
by
Eike Ziller
Browse files
Options
Downloads
Plain Diff
Merge branch '2.8' of
ssh://codereview.qt-project.org/qt-creator/qt-creator
into 2.8
parents
8d894aee
ff0a5e81
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qbsprojectmanager/qbsnodes.cpp
+16
-9
16 additions, 9 deletions
src/plugins/qbsprojectmanager/qbsnodes.cpp
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
+1
-0
1 addition, 0 deletions
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
with
17 additions
and
9 deletions
src/plugins/qbsprojectmanager/qbsnodes.cpp
+
16
−
9
View file @
cbfcf88f
...
...
@@ -89,8 +89,8 @@ QIcon QbsGroupNode::m_groupIcon = generateIcon();
class
FileTreeNode
{
public:
explicit
FileTreeNode
(
const
QString
&
n
=
QString
(),
FileTreeNode
*
p
=
0
)
:
parent
(
p
),
name
(
n
)
explicit
FileTreeNode
(
const
QString
&
n
=
QString
(),
FileTreeNode
*
p
=
0
,
bool
f
=
false
)
:
parent
(
p
),
name
(
n
)
,
m_isFile
(
f
)
{
if
(
p
)
p
->
children
.
append
(
this
);
...
...
@@ -101,16 +101,16 @@ public:
qDeleteAll
(
children
);
}
FileTreeNode
*
addPart
(
const
QString
&
n
)
FileTreeNode
*
addPart
(
const
QString
&
n
,
bool
isFile
)
{
foreach
(
FileTreeNode
*
c
,
children
)
{
if
(
c
->
name
==
n
)
return
c
;
}
return
new
FileTreeNode
(
n
,
this
);
return
new
FileTreeNode
(
n
,
this
,
isFile
);
}
bool
isFile
()
{
return
children
.
isEmpty
()
;
}
bool
isFile
()
{
return
m_isFile
;
}
static
FileTreeNode
*
moveChildrenUp
(
FileTreeNode
*
node
)
{
...
...
@@ -145,6 +145,10 @@ public:
static
void
reorder
(
FileTreeNode
*
node
,
const
QString
&
basedir
)
{
QTC_CHECK
(
!
basedir
.
isEmpty
());
QString
prefix
=
basedir
;
if
(
basedir
.
startsWith
(
QLatin1Char
(
'/'
)))
prefix
=
basedir
.
mid
(
1
);
prefix
.
append
(
QLatin1Char
(
'/'
));
if
(
node
->
path
()
==
basedir
)
{
// Find root node:
...
...
@@ -154,7 +158,7 @@ public:
foreach
(
FileTreeNode
*
c
,
node
->
children
)
{
// Update children names by prepending basedir
c
->
name
=
basedir
+
QLatin1Char
(
'/'
)
+
c
->
name
;
c
->
name
=
prefix
+
c
->
name
;
// Update parent information:
c
->
parent
=
root
;
...
...
@@ -182,7 +186,7 @@ public:
if
(
!
node
->
parent
)
return
;
if
(
node
->
children
.
count
()
==
0
&&
!
node
->
isFile
())
{
if
(
node
->
children
.
isEmpty
()
&&
!
node
->
isFile
())
{
// Clean up empty folder nodes:
node
->
parent
->
children
.
removeOne
(
node
);
node
->
parent
=
0
;
...
...
@@ -208,6 +212,7 @@ public:
QList
<
FileTreeNode
*>
children
;
FileTreeNode
*
parent
;
QString
name
;
bool
m_isFile
;
};
// ----------------------------------------------------------------------
...
...
@@ -362,8 +367,10 @@ void QbsGroupNode::setupFiles(QbsBaseProjectNode *root, const QStringList &files
QStringList
pathSegments
=
path
.
split
(
QLatin1Char
(
'/'
),
QString
::
SkipEmptyParts
);
FileTreeNode
*
root
=
&
tree
;
while
(
!
pathSegments
.
isEmpty
())
root
=
root
->
addPart
(
pathSegments
.
takeFirst
());
while
(
!
pathSegments
.
isEmpty
())
{
bool
isFile
=
pathSegments
.
count
()
==
1
;
root
=
root
->
addPart
(
pathSegments
.
takeFirst
(),
isFile
);
}
}
FileTreeNode
::
reorder
(
&
tree
,
productPath
);
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
+
1
−
0
View file @
cbfcf88f
...
...
@@ -423,6 +423,7 @@ void Qt4ProjectManagerPlugin::updateBuildFileAction()
ProjectExplorer
::
Project
*
project
=
session
->
projectForFile
(
file
);
m_buildFileAction
->
setParameter
(
QFileInfo
(
file
).
fileName
());
visible
=
qobject_cast
<
Qt4Project
*>
(
project
)
&&
node
&&
qobject_cast
<
Qt4ProFileNode
*>
(
node
->
projectNode
());
enabled
=
!
m_projectExplorer
->
buildManager
()
->
isBuilding
(
project
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment