Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
4c5ce801
Commit
4c5ce801
authored
Mar 26, 2010
by
Tobias Hunger
Browse files
Add method to retreive valid Qt versions only
parent
74ae8314
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/projectloadwizard.cpp
View file @
4c5ce801
...
...
@@ -89,12 +89,7 @@ ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::W
// The default buildConfiguration depends on QmakeBuildConfig::DebugBuild
// Also if the qt version is not yet in the Tools Options dialog we offer to add it there
QList
<
QtVersion
*>
validVersions
;
foreach
(
QtVersion
*
v
,
vm
->
versions
())
{
if
(
v
->
isValid
())
validVersions
.
append
(
v
);
}
QList
<
QtVersion
*>
validVersions
=
vm
->
validVersions
();
if
(
m_importVersion
)
setupImportPage
(
m_importVersion
,
m_importBuildConfig
,
m_additionalArguments
);
else
if
(
validVersions
.
count
()
>
1
)
...
...
src/plugins/qt4projectmanager/qtversionmanager.cpp
View file @
4c5ce801
...
...
@@ -159,6 +159,9 @@ QtVersionManager *QtVersionManager::instance()
void
QtVersionManager
::
addVersion
(
QtVersion
*
version
)
{
QTC_ASSERT
(
version
!=
0
,
return
);
if
(
m_versions
.
contains
(
version
))
return
;
m_versions
.
append
(
version
);
int
uniqueId
=
version
->
uniqueId
();
m_uniqueIdToIndex
.
insert
(
uniqueId
,
m_versions
.
count
()
-
1
);
...
...
@@ -278,11 +281,21 @@ void QtVersionManager::writeVersionsIntoSettings()
s
->
endArray
();
}
QList
<
QtVersion
*
>
QtVersionManager
::
versions
()
const
QList
<
QtVersion
*
>
QtVersionManager
::
versions
()
const
{
return
m_versions
;
}
QList
<
QtVersion
*>
QtVersionManager
::
validVersions
()
const
{
QList
<
QtVersion
*>
results
;
foreach
(
QtVersion
*
v
,
m_versions
)
{
if
(
v
->
isValid
())
results
.
append
(
v
);
}
return
results
;
}
bool
QtVersionManager
::
isValidId
(
int
id
)
const
{
int
pos
=
m_uniqueIdToIndex
.
value
(
id
,
-
1
);
...
...
src/plugins/qt4projectmanager/qtversionmanager.h
View file @
4c5ce801
...
...
@@ -199,6 +199,7 @@ public:
// This will *always* return at least one (Qt in Path), even if that is
// unconfigured.
QList
<
QtVersion
*>
versions
()
const
;
QList
<
QtVersion
*>
validVersions
()
const
;
// Note: DO NOT STORE THIS POINTER!
// The QtVersionManager will delete it at random times and you will
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment