MCPcopy Create free account
hub / github.com/KDE/kdevelop / repopulate

Method repopulate

plugins/meson/settings/mesonoptionsview.cpp:61–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61KJob* MesonOptionsView::repopulate(MesonIntrospectJob* introJob)
62{
63 setDisabled(true);
64
65 connect(introJob, &KJob::result, this, [this, introJob]() {
66 m_optViews.clear();
67 m_options = introJob->buildOptions();
68 if (!m_options) {
69 qCWarning(KDEV_Meson) << "Failed to get introspection data";
70 return;
71 }
72
73 for (auto i : m_options->options()) {
74 OPT_VIEW_PTR opt = MesonOptionBaseView::fromOption(i, m_ui->tabWidget);
75
76 if (!opt) {
77 qCWarning(KDEV_Meson) << "Unhandled option type " << i->type();
78 continue;
79 }
80
81 QVBoxLayout* layout = nullptr;
82
83 switch (i->section()) {
84 case MesonOptionBase::CORE:
85 layout = m_ui->l_core;
86 break;
87 case MesonOptionBase::BACKEND:
88 layout = m_ui->l_backend;
89 break;
90 case MesonOptionBase::BASE:
91 layout = m_ui->l_base;
92 break;
93 case MesonOptionBase::COMPILER:
94 layout = m_ui->l_compiler;
95 break;
96 case MesonOptionBase::DIRECTORY:
97 layout = m_ui->l_directory;
98 break;
99 case MesonOptionBase::USER:
100 layout = m_ui->l_user;
101 break;
102 case MesonOptionBase::TEST:
103 layout = m_ui->l_test;
104 break;
105 }
106
107 if (!layout) {
108 qCWarning(KDEV_Meson) << "Unknown section " << i->section();
109 }
110
111 connect(opt.get(), &MesonOptionBaseView::configChanged, this, &MesonOptionsView::emitChanged);
112
113 // Insert at count() - 1 to keep the stretch at the bottom
114 layout->insertWidget(layout->count() - 1, opt.get());
115 m_optViews << opt;
116 }
117
118 auto maxEl = max_element(begin(m_optViews), end(m_optViews),

Callers

nothing calls this directly

Calls 11

buildOptionsMethod · 0.80
sectionMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
clearMethod · 0.45
optionsMethod · 0.45
typeMethod · 0.45
getMethod · 0.45
countMethod · 0.45
nameWidthMethod · 0.45
setMinNameWidthMethod · 0.45

Tested by

no test coverage detected