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

Method onDefaultCheckSetSelectionChanged

plugins/clazy/checksetselectionmanager.cpp:417–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void CheckSetSelectionManager::onDefaultCheckSetSelectionChanged(const QString& path)
418{
419 QFile defaultCheckSetSelectionFile(path);
420 if (!defaultCheckSetSelectionFile.open(QIODevice::ReadOnly)) {
421 qCDebug(KDEV_CLAZY) << "Failed to open checkset selection file " << path;
422 return;
423 }
424
425 const QByteArray fileContent = defaultCheckSetSelectionFile.readAll();
426 const QString checkSetSelectionId = QString::fromUtf8(fileContent);
427 defaultCheckSetSelectionFile.close();
428
429 // no id set?
430 if (checkSetSelectionId.isEmpty()) {
431 return;
432 }
433
434 // no change?
435 if (m_defaultCheckSetSelectionId == checkSetSelectionId) {
436 return;
437 }
438
439 bool isExisting = false;
440 for (const CheckSetSelection& checkSetSelection : std::as_const(m_checkSetSelections)) {
441 if (checkSetSelection.id() == checkSetSelectionId) {
442 isExisting = true;
443 break;
444 }
445 }
446
447 if (isExisting) {
448 m_defaultCheckSetSelectionId = checkSetSelectionId;
449 emit defaultCheckSetSelectionChanged(m_defaultCheckSetSelectionId);
450 }
451}
452
453}
454

Callers

nothing calls this directly

Calls 4

openMethod · 0.45
closeMethod · 0.45
isEmptyMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected