  }
  
  void MainWindow::saveFile(const QString &fn) {
    QFile file(fn);
    if (file.open(QIODevice::WriteOnly)) {
      file.write(dbc()->generateDBC().toUtf8());
      UndoStack::instance()->setClean();
      setCurrentFile(fn);
 
</s> remove     QFile file(fn);
 </s> add     QString dbc_fn = fn;

    // Prompt user to load auto saved file if it exists.
    if (QFile::exists(fn + AUTO_SAVE_EXTENSION)) {
      auto ret = QMessageBox::question(this, tr("Auto saved DBC found"), tr("Auto saved DBC file from previous session found. Do you want to load it instead?"));
      if (ret == QMessageBox::Yes) {
        dbc_fn += AUTO_SAVE_EXTENSION;
        UndoStack::instance()->resetClean(); // Force user to save on close so the auto saved file is not lost
      }
    }

    QFile file(dbc_fn);
  cleanupAutoSaveFile();
  }
  
  void MainWindow::saveFile(const QString &fn) {
  cleanupAutoSaveFile();
    QFile file(fn);
    if (file.open(QIODevice::WriteOnly)) {
      file.write(dbc()->generateDBC().toUtf8());
      UndoStack::instance()->setClean();
      setCurrentFile(fn);
keep keep add keep keep keep keep keep
 cabana: create autosave file when there are unsaved changes (#27542) 
tools/cabana/mainwin.cc