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
Marco Bubke
flatpak-qt-creator
Commits
5784e2ad
Commit
5784e2ad
authored
May 25, 2010
by
Daniel Molkentin
Browse files
prefer adding Qt versions shipping with QML examples
Reviewed-by: dt
parent
43c892d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qtversionmanager.cpp
View file @
5784e2ad
...
...
@@ -228,23 +228,30 @@ void QtVersionManager::updateDocumentation()
void
QtVersionManager
::
updateExamples
()
{
QList
<
QtVersion
*>
versions
;
versions
.
append
(
m_versions
);
QString
examplesPath
;
QString
demosPath
;
QtVersion
*
version
=
0
;
QList
<
QtVersion
*>
candidates
;
// try to find a version which has both, demos and examples
foreach
(
version
,
versions
)
{
if
(
version
->
hasExamples
())
examplesPath
=
version
->
examplesPath
();
if
(
version
->
hasDemos
())
demosPath
=
version
->
demosPath
();
if
(
!
examplesPath
.
isEmpty
()
&&
!
demosPath
.
isEmpty
())
{
emit
updateExamples
(
examplesPath
,
demosPath
,
version
->
sourcePath
());
foreach
(
version
,
m_versions
)
{
if
(
version
->
hasExamples
()
&&
version
->
hasDemos
())
candidates
.
append
(
version
);
}
// prefer versions with declarative examples
foreach
(
version
,
candidates
)
{
if
(
QDir
(
version
->
examplesPath
()
+
"/declarative"
).
exists
())
{
emit
updateExamples
(
version
->
examplesPath
(),
version
->
demosPath
(),
version
->
sourcePath
());
return
;
}
}
if
(
!
candidates
.
isEmpty
())
{
version
=
candidates
.
first
();
emit
updateExamples
(
version
->
examplesPath
(),
version
->
demosPath
(),
version
->
sourcePath
());
return
;
}
return
;
}
int
QtVersionManager
::
getUniqueId
()
...
...
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