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.
This commit is contained in:
@@ -157,6 +157,10 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa
|
|||||||
QString fileName = examplePath + relativeProPath;
|
QString fileName = examplePath + relativeProPath;
|
||||||
if (!QFile::exists(fileName))
|
if (!QFile::exists(fileName))
|
||||||
fileName = sourcePath + QLatin1String("/examples") + relativeProPath;
|
fileName = sourcePath + QLatin1String("/examples") + relativeProPath;
|
||||||
|
if (!QFile::exists(fileName)) {
|
||||||
|
continue; // might be .qmlproject
|
||||||
|
}
|
||||||
|
|
||||||
QString dirName1 = dirName;
|
QString dirName1 = dirName;
|
||||||
dirName1.replace(slash, QLatin1Char('-'));
|
dirName1.replace(slash, QLatin1Char('-'));
|
||||||
QString helpPath = QLatin1String("qthelp://com.trolltech.qt/qdoc/") +
|
QString helpPath = QLatin1String("qthelp://com.trolltech.qt/qdoc/") +
|
||||||
@@ -178,6 +182,15 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa
|
|||||||
break;
|
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,
|
void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePath,
|
||||||
|
Reference in New Issue
Block a user