forked from qt-creator/qt-creator
Don't show qml only projects under C++ examples
Filter out all examples that are missing a .pro file. Afterwards
remove empty categories.
(cherry picked from commit 56f735425a
)
This commit is contained in:
@@ -163,6 +163,10 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa
|
||||
QString fileName = examplePath + relativeProPath;
|
||||
if (!QFile::exists(fileName))
|
||||
fileName = sourcePath + QLatin1String("/examples") + relativeProPath;
|
||||
if (!QFile::exists(fileName)) {
|
||||
continue; // might be .qmlproject
|
||||
}
|
||||
|
||||
QString dirName1 = dirName;
|
||||
dirName1.replace(slash, QLatin1Char('-'));
|
||||
QString helpPath = QLatin1String("qthelp://com.trolltech.qt/qdoc/") +
|
||||
@@ -184,6 +188,15 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty categories
|
||||
foreach (QAction *action, menu->actions()) {
|
||||
if (QMenu *subMenu = action->menu()) {
|
||||
if (subMenu->isEmpty()) {
|
||||
menu->removeAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePath,
|
||||
|
Reference in New Issue
Block a user