forked from qt-creator/qt-creator
Do not add a menu if the examples cannot be found.
This is not only a waste of ressources, but breaks a check later on which tries to load the QML examples from Creators ressource path if no QML capable Qt version is found (included with Creator packages) Reviewed-by: dt
This commit is contained in:
1
share/qtcreator/declarative
Symbolic link
1
share/qtcreator/declarative
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
examples/declarative/
|
||||||
1
share/qtcreator/examples
Symbolic link
1
share/qtcreator/examples
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/danimo/dev/qt-4.7/examples/
|
||||||
@@ -175,8 +175,6 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
const QString &sourcePath)
|
const QString &sourcePath)
|
||||||
{
|
{
|
||||||
ui->qmlExamplesButton->setText(tr("Choose an example..."));
|
ui->qmlExamplesButton->setText(tr("Choose an example..."));
|
||||||
QMenu *menu = new QMenu(ui->qmlExamplesButton);
|
|
||||||
ui->qmlExamplesButton->setMenu(menu);
|
|
||||||
|
|
||||||
QStringList roots;
|
QStringList roots;
|
||||||
roots << (examplePath + QLatin1String("/declarative"))
|
roots << (examplePath + QLatin1String("/declarative"))
|
||||||
@@ -197,6 +195,11 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
exampleProjects.insert(fileName, exampleProject);
|
exampleProjects.insert(fileName, exampleProject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!exampleProjects.isEmpty()) {
|
||||||
|
QMenu *menu = new QMenu(ui->qmlExamplesButton);
|
||||||
|
ui->qmlExamplesButton->setMenu(menu);
|
||||||
|
|
||||||
QMapIterator<QString, QString> it(exampleProjects);
|
QMapIterator<QString, QString> it(exampleProjects);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
@@ -206,6 +209,7 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
// FIXME once we have help for QML examples
|
// FIXME once we have help for QML examples
|
||||||
// exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
// exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ui->qmlExamplesButton->setEnabled(!exampleProjects.isEmpty());
|
ui->qmlExamplesButton->setEnabled(!exampleProjects.isEmpty());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user