Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
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
Tobias Hunger
qt-creator
Commits
e4d5d004
Commit
e4d5d004
authored
15 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Fix creating of projects
parent
2d60bd35
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/qt4projectmanager/qt4project.cpp
+18
-54
18 additions, 54 deletions
src/plugins/qt4projectmanager/qt4project.cpp
src/plugins/qt4projectmanager/qt4project.h
+1
-2
1 addition, 2 deletions
src/plugins/qt4projectmanager/qt4project.h
with
19 additions
and
56 deletions
src/plugins/qt4projectmanager/qt4project.cpp
+
18
−
54
View file @
e4d5d004
...
@@ -312,9 +312,7 @@ bool Qt4Project::fromMap(const QVariantMap &map)
...
@@ -312,9 +312,7 @@ bool Qt4Project::fromMap(const QVariantMap &map)
updateFileList
();
updateFileList
();
// This might be incorrect, need a full update
// This might be incorrect, need a full update
updateCodeModel
();
updateCodeModel
();
createApplicationProjects
();
checkForNewApplicationProjects
();
checkForDeletedApplicationProjects
();
foreach
(
Target
*
t
,
targets
())
foreach
(
Target
*
t
,
targets
())
onAddedTarget
(
t
);
onAddedTarget
(
t
);
...
@@ -766,8 +764,6 @@ void Qt4Project::decrementPendingEvaluateFutures()
...
@@ -766,8 +764,6 @@ void Qt4Project::decrementPendingEvaluateFutures()
// After beeing done, we need to call:
// After beeing done, we need to call:
updateFileList
();
updateFileList
();
updateCodeModel
();
updateCodeModel
();
checkForNewApplicationProjects
();
checkForDeletedApplicationProjects
();
if
(
debug
)
if
(
debug
)
qDebug
()
<<
" Setting state to Base"
;
qDebug
()
<<
" Setting state to Base"
;
m_asyncUpdateState
=
Base
;
m_asyncUpdateState
=
Base
;
...
@@ -980,61 +976,29 @@ void Qt4Project::collectApplicationProFiles(QList<Qt4ProFileNode *> &list, Qt4Pr
...
@@ -980,61 +976,29 @@ void Qt4Project::collectApplicationProFiles(QList<Qt4ProFileNode *> &list, Qt4Pr
}
}
}
}
void
Qt4Project
::
c
heckForNew
ApplicationProjects
()
void
Qt4Project
::
c
reate
ApplicationProjects
()
{
{
// Check all new project nodes
foreach
(
Target
*
target
,
targets
())
{
// against all runConfigurations in all targets.
if
(
target
->
runConfigurations
().
count
())
{
// Remove all run configurations which the new project wizard created
foreach
(
Qt4ProFileNode
*
qt4proFile
,
applicationProFiles
())
{
QList
<
RunConfiguration
*>
toRemove
;
foreach
(
Target
*
target
,
targets
())
{
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
{
Qt4Target
*
qt4Target
=
static_cast
<
Qt4Target
*>
(
target
);
CustomExecutableRunConfiguration
*
cerc
=
qobject_cast
<
CustomExecutableRunConfiguration
*>
(
rc
);
bool
found
=
false
;
if
(
cerc
&&
!
cerc
->
isConfigured
())
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
{
toRemove
.
append
(
rc
);
Qt4RunConfiguration
*
qtrc
=
qobject_cast
<
Qt4RunConfiguration
*>
(
rc
);
if
(
qtrc
&&
qtrc
->
proFilePath
()
==
qt4proFile
->
path
())
{
found
=
true
;
break
;
}
}
if
(
!
found
)
{
qt4Target
->
addRunConfigurationForPath
(
qt4proFile
->
path
());
}
// Remove unused CustomExecutableRCs:
if
(
target
->
runConfigurations
().
count
()
>
1
)
{
QList
<
RunConfiguration
*>
toRemove
;
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
{
CustomExecutableRunConfiguration
*
cerc
=
qobject_cast
<
CustomExecutableRunConfiguration
*>
(
rc
);
if
(
cerc
&&
!
cerc
->
isConfigured
())
toRemove
.
append
(
rc
);
}
foreach
(
RunConfiguration
*
rc
,
toRemove
)
target
->
removeRunConfiguration
(
rc
);
}
}
foreach
(
RunConfiguration
*
rc
,
toRemove
)
target
->
removeRunConfiguration
(
rc
);
}
}
}
}
void
Qt4Project
::
checkForDeletedApplicationProjects
()
{
QStringList
paths
;
foreach
(
Qt4ProFileNode
*
node
,
applicationProFiles
())
paths
.
append
(
node
->
path
());
// qDebug()<<"Still existing paths :"<<paths;
// Only add new runconfigurations if there are none.
if
(
target
->
runConfigurations
().
isEmpty
())
{
QList
<
Qt4RunConfiguration
*>
removeList
;
Qt4Target
*
qt4Target
=
static_cast
<
Qt4Target
*>
(
target
);
foreach
(
Target
*
target
,
targets
())
{
foreach
(
Qt4ProFileNode
*
qt4proFile
,
applicationProFiles
())
{
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
{
qt4Target
->
addRunConfigurationForPath
(
qt4proFile
->
path
());
if
(
Qt4RunConfiguration
*
qt4rc
=
qobject_cast
<
Qt4RunConfiguration
*>
(
rc
))
{
if
(
!
paths
.
contains
(
qt4rc
->
proFilePath
()))
{
removeList
.
append
(
qt4rc
);
}
}
}
}
}
foreach
(
Qt4RunConfiguration
*
qt4rc
,
removeList
)
// Oh still none? Add a custom executable runconfiguration
target
->
removeRunConfiguration
(
qt4rc
);
if
(
target
->
runConfigurations
().
isEmpty
())
{
if
(
target
->
runConfigurations
().
isEmpty
())
{
target
->
addRunConfiguration
(
new
ProjectExplorer
::
CustomExecutableRunConfiguration
(
target
));
target
->
addRunConfiguration
(
new
ProjectExplorer
::
CustomExecutableRunConfiguration
(
target
));
}
}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt4project.h
+
1
−
2
View file @
e4d5d004
...
@@ -185,8 +185,7 @@ private slots:
...
@@ -185,8 +185,7 @@ private slots:
private:
private:
void
scheduleAsyncUpdate
();
void
scheduleAsyncUpdate
();
void
checkForNewApplicationProjects
();
void
createApplicationProjects
();
void
checkForDeletedApplicationProjects
();
void
updateCodeModel
();
void
updateCodeModel
();
void
updateFileList
();
void
updateFileList
();
...
...
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