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
dceda9db
Commit
dceda9db
authored
15 years ago
by
Tobias Hunger
Browse files
Options
Downloads
Patches
Plain Diff
Refresh ProjectMode when supported targets change
Reviewed-by: con
parent
6ecd9cc5
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/projectexplorer/projectwindow.cpp
+21
-4
21 additions, 4 deletions
src/plugins/projectexplorer/projectwindow.cpp
src/plugins/projectexplorer/projectwindow.h
+4
-2
4 additions, 2 deletions
src/plugins/projectexplorer/projectwindow.h
with
25 additions
and
6 deletions
src/plugins/projectexplorer/projectwindow.cpp
+
21
−
4
View file @
dceda9db
...
@@ -277,9 +277,9 @@ ProjectWindow::ProjectWindow(QWidget *parent)
...
@@ -277,9 +277,9 @@ ProjectWindow::ProjectWindow(QWidget *parent)
connect
(
session
,
SIGNAL
(
aboutToSaveSession
()),
this
,
SLOT
(
saveStatus
()));
connect
(
session
,
SIGNAL
(
aboutToSaveSession
()),
this
,
SLOT
(
saveStatus
()));
connect
(
session
,
SIGNAL
(
projectAdded
(
ProjectExplorer
::
Project
*
)),
connect
(
session
,
SIGNAL
(
projectAdded
(
ProjectExplorer
::
Project
*
)),
this
,
SLOT
(
p
roject
Added
(
ProjectExplorer
::
Project
*
)));
this
,
SLOT
(
registerP
roject
(
ProjectExplorer
::
Project
*
)));
connect
(
session
,
SIGNAL
(
aboutToRemoveProject
(
ProjectExplorer
::
Project
*
)),
connect
(
session
,
SIGNAL
(
aboutToRemoveProject
(
ProjectExplorer
::
Project
*
)),
this
,
SLOT
(
aboutToRemove
Project
(
ProjectExplorer
::
Project
*
)));
this
,
SLOT
(
deregister
Project
(
ProjectExplorer
::
Project
*
)));
// Update properties to empty project for now:
// Update properties to empty project for now:
showProperties
(
-
1
,
-
1
);
showProperties
(
-
1
,
-
1
);
...
@@ -296,7 +296,7 @@ void ProjectWindow::shutdown()
...
@@ -296,7 +296,7 @@ void ProjectWindow::shutdown()
disconnect
(
ProjectExplorerPlugin
::
instance
()
->
session
(),
0
,
this
,
0
);
disconnect
(
ProjectExplorerPlugin
::
instance
()
->
session
(),
0
,
this
,
0
);
}
}
void
ProjectWindow
::
p
roject
Added
(
ProjectExplorer
::
Project
*
project
)
void
ProjectWindow
::
registerP
roject
(
ProjectExplorer
::
Project
*
project
)
{
{
if
(
!
project
||
m_tabIndexToProject
.
contains
(
project
))
if
(
!
project
||
m_tabIndexToProject
.
contains
(
project
))
return
;
return
;
...
@@ -320,13 +320,20 @@ void ProjectWindow::projectAdded(ProjectExplorer::Project *project)
...
@@ -320,13 +320,20 @@ void ProjectWindow::projectAdded(ProjectExplorer::Project *project)
m_tabIndexToProject
.
insert
(
index
,
project
);
m_tabIndexToProject
.
insert
(
index
,
project
);
m_tabWidget
->
insertTab
(
index
,
project
->
displayName
(),
subtabs
);
m_tabWidget
->
insertTab
(
index
,
project
->
displayName
(),
subtabs
);
connect
(
project
,
SIGNAL
(
supportedTargetIdsChanged
()),
this
,
SLOT
(
refreshProject
()));
}
}
void
ProjectWindow
::
aboutToRemove
Project
(
ProjectExplorer
::
Project
*
project
)
void
ProjectWindow
::
deregister
Project
(
ProjectExplorer
::
Project
*
project
)
{
{
int
index
=
m_tabIndexToProject
.
indexOf
(
project
);
int
index
=
m_tabIndexToProject
.
indexOf
(
project
);
if
(
index
<
0
)
if
(
index
<
0
)
return
;
return
;
disconnect
(
project
,
SIGNAL
(
supportedTargetIdsChanged
()),
this
,
SLOT
(
refreshProject
()));
m_tabIndexToProject
.
removeAt
(
index
);
m_tabIndexToProject
.
removeAt
(
index
);
m_tabWidget
->
removeTab
(
index
);
m_tabWidget
->
removeTab
(
index
);
}
}
...
@@ -341,6 +348,16 @@ void ProjectWindow::saveStatus()
...
@@ -341,6 +348,16 @@ void ProjectWindow::saveStatus()
// TODO
// TODO
}
}
void
ProjectWindow
::
refreshProject
()
{
Project
*
project
=
qobject_cast
<
ProjectExplorer
::
Project
*>
(
sender
());
if
(
!
m_tabIndexToProject
.
contains
(
project
))
return
;
deregisterProject
(
project
);
registerProject
(
project
);
}
void
ProjectWindow
::
showProperties
(
int
index
,
int
subIndex
)
void
ProjectWindow
::
showProperties
(
int
index
,
int
subIndex
)
{
{
if
(
index
<
0
||
index
>=
m_tabIndexToProject
.
count
())
if
(
index
<
0
||
index
>=
m_tabIndexToProject
.
count
())
...
...
This diff is collapsed.
Click to expand it.
src/plugins/projectexplorer/projectwindow.h
+
4
−
2
View file @
dceda9db
...
@@ -90,8 +90,10 @@ private slots:
...
@@ -90,8 +90,10 @@ private slots:
void
showProperties
(
int
index
,
int
subIndex
);
void
showProperties
(
int
index
,
int
subIndex
);
void
restoreStatus
();
void
restoreStatus
();
void
saveStatus
();
void
saveStatus
();
void
projectAdded
(
ProjectExplorer
::
Project
*
);
void
registerProject
(
ProjectExplorer
::
Project
*
);
void
aboutToRemoveProject
(
ProjectExplorer
::
Project
*
);
void
deregisterProject
(
ProjectExplorer
::
Project
*
);
void
refreshProject
();
private:
private:
void
removeCurrentWidget
();
void
removeCurrentWidget
();
...
...
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