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

Method setSourceWidget

kdevplatform/shell/projectsourcepage.cpp:101–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void ProjectSourcePage::setSourceWidget(int index, const QUrl& repoUrl)
102{
103 m_locationWidget = nullptr;
104 m_providerWidget = nullptr;
105 QLayoutItem *child;
106 while ((child = m_ui->remoteWidgetLayout->takeAt(0)) != nullptr) {
107 delete child->widget();
108 delete child;
109 }
110
111 IBasicVersionControl* vcIface = vcsPerIndex(index);
112 IProjectProvider* providerIface;
113 bool found=false;
114 if(vcIface) {
115 found=true;
116 m_locationWidget=vcIface->vcsLocation(m_ui->sourceBox);
117 connect(m_locationWidget, &VcsLocationWidget::changed, this, &ProjectSourcePage::locationChanged);
118
119 // set after connect, to trigger handler
120 if (!repoUrl.isEmpty()) {
121 m_locationWidget->setLocation(repoUrl);
122 }
123 m_ui->remoteWidgetLayout->addWidget(m_locationWidget);
124 } else {
125 providerIface = providerPerIndex(index);
126 if(providerIface) {
127 found=true;
128 m_providerWidget=providerIface->providerWidget(m_ui->sourceBox);
129 connect(m_providerWidget, &IProjectProviderWidget::changed, this, &ProjectSourcePage::projectChanged);
130
131 m_ui->remoteWidgetLayout->addWidget(m_providerWidget);
132 }
133 }
134 reevaluateCorrection();
135
136 m_ui->sourceBox->setVisible(found);
137}
138
139IBasicVersionControl* ProjectSourcePage::vcsPerIndex(int index)
140{

Callers

nothing calls this directly

Calls 7

providerWidgetMethod · 0.80
widgetMethod · 0.45
vcsLocationMethod · 0.45
isEmptyMethod · 0.45
setLocationMethod · 0.45
addWidgetMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected