  int DBCManager::dbcCount() const {
    return dbc_files.size();
  }
  
  void DBCManager::updateSources(const SourceSet &s) {
    sources = s;
  }
  
 
</s> remove   assert(dbc()->dbcCount() > 0);

  auto &[_, dbc_file] = dbc()->dbc_files.first();
  QGuiApplication::clipboard()->setText(dbc_file->generateDBC());
  QMessageBox::information(this, tr("Copy To Clipboard"), tr("DBC Successfully copied!"));
 </s> add   for (auto &[s, dbc_file] : dbc()->dbc_files) {
    if (dbc_file->isEmpty()) continue;
    QGuiApplication::clipboard()->setText(dbc_file->generateDBC());
    QMessageBox::information(this, tr("Copy To Clipboard"), tr("DBC Successfully copied!"));
  } </s> remove   if (dbc()->dbcCount() > 1) {
 </s> add   int cnt = dbc()->nonEmptyDBCCount();
  save_dbc->setEnabled(cnt > 0);

  if (cnt > 1) { </s> remove     } else {
 </s> add     } else if (!dbc_file->isEmpty()) {
int DBCManager::nonEmptyDBCCount() const {
  int cnt = 0;
  for (auto &[_, dbc_file] : dbc_files) {
    if (!dbc_file->isEmpty()) {
      cnt++;
    }
  }
  return cnt;
}

  int DBCManager::dbcCount() const {
    return dbc_files.size();
  }
  
int DBCManager::nonEmptyDBCCount() const {
  int cnt = 0;
  for (auto &[_, dbc_file] : dbc_files) {
    if (!dbc_file->isEmpty()) {
      cnt++;
    }
  }
  return cnt;
}

  void DBCManager::updateSources(const SourceSet &s) {
    sources = s;
  }
  
keep keep keep add keep keep keep keep
 cabana: do not try to save empty wildcard DBC (#27898)

* cabana: do not try to save empty wildcard DBC

* use reference 
tools/cabana/dbc/dbcmanager.cc