forked from qt-creator/qt-creator
Target setup page: Handle slow kit manager
It has been observed by users (though not reproduced here) that the target setup page would apparently appear before the kit manager was finished setting up the initial kits, leading to an empty kit list on the target setup page even after the kits were finally loaded. We now take this possibility into account. Fixes: QTCREATORBUG-22353 Change-Id: I83cdc3da45785c3badfac484a54f34859191cc37 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -209,12 +209,12 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
|
||||
|
||||
void TargetSetupPage::initializePage()
|
||||
{
|
||||
reset();
|
||||
|
||||
setupWidgets();
|
||||
setupImports();
|
||||
selectAtLeastOneKit();
|
||||
updateVisibility();
|
||||
if (KitManager::isLoaded()) {
|
||||
doInitializePage();
|
||||
} else {
|
||||
connect(KitManager::instance(), &KitManager::kitsLoaded,
|
||||
this, &TargetSetupPage::doInitializePage);
|
||||
}
|
||||
}
|
||||
|
||||
void TargetSetupPage::setRequiredKitPredicate(const Kit::Predicate &predicate)
|
||||
@@ -494,6 +494,15 @@ void TargetSetupPage::kitFilterChanged(const QString &filterText)
|
||||
selectAtLeastOneKit();
|
||||
}
|
||||
|
||||
void TargetSetupPage::doInitializePage()
|
||||
{
|
||||
reset();
|
||||
setupWidgets();
|
||||
setupImports();
|
||||
selectAtLeastOneKit();
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
void TargetSetupPage::changeAllKitsSelections()
|
||||
{
|
||||
if (m_ui->allKitsCheckBox->checkState() == Qt::PartiallyChecked)
|
||||
|
@@ -87,6 +87,8 @@ public:
|
||||
void kitFilterChanged(const QString &filterText);
|
||||
|
||||
private:
|
||||
void doInitializePage();
|
||||
|
||||
void handleKitAddition(Kit *k);
|
||||
void handleKitRemoval(Kit *k);
|
||||
void handleKitUpdate(Kit *k);
|
||||
|
Reference in New Issue
Block a user