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

Method statusReady

kdevplatform/project/projectchangesmodel.cpp:152–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void ProjectChangesModel::statusReady(KJob* job)
153{
154 auto* status=static_cast<VcsJob*>(job);
155
156 const QList<QVariant> states = status->fetchResults().toList();
157 auto* project = job->property("project").value<KDevelop::IProject*>();
158 if(!project)
159 return;
160
161 QSet<QUrl> foundUrls;
162 foundUrls.reserve(states.size());
163 for (const QVariant& state : states) {
164 const VcsStatusInfo st = state.value<VcsStatusInfo>();
165 foundUrls += st.url();
166
167 updateState(project, st);
168 }
169
170 QStandardItem* itProject = projectItem(project);
171 if (!itProject) {
172 qCDebug(PROJECT) << "Project no longer listed in model:" << project->name() << "- skipping update";
173 return;
174 }
175
176 IBasicVersionControl::RecursionMode mode = IBasicVersionControl::RecursionMode(job->property("mode").toInt());
177 const QList<QUrl> projectUrls = urls(itProject);
178 const QSet<QUrl> uncertainUrls = QSet<QUrl>(projectUrls.begin(), projectUrls.end()).subtract(foundUrls);
179 const QList<QUrl> sourceUrls = job->property("urls").value<QList<QUrl>>();
180 for (const QUrl& url : sourceUrls) {
181 if(url.isLocalFile() && QDir(url.toLocalFile()).exists()) {
182 for (const QUrl& currentUrl : uncertainUrls) {
183 if((mode == IBasicVersionControl::NonRecursive && currentUrl.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash) == url.adjusted(QUrl::StripTrailingSlash))
184 || (mode == IBasicVersionControl::Recursive && url.isParentOf(currentUrl))
185 ) {
186 removeUrl(itProject->index(), currentUrl);
187 }
188 }
189 }
190 }
191}
192
193void ProjectChangesModel::documentSaved(KDevelop::IDocument* document)
194{

Callers

nothing calls this directly

Calls 15

updateStateFunction · 0.85
RecursionModeEnum · 0.85
urlsFunction · 0.85
propertyMethod · 0.80
toIntMethod · 0.80
isLocalFileMethod · 0.80
existsMethod · 0.80
toLocalFileMethod · 0.80
isParentOfMethod · 0.80
QDirClass · 0.50
toListMethod · 0.45
fetchResultsMethod · 0.45

Tested by

no test coverage detected