Refactoring.

This commit is contained in:
Roman Telezhynskyi 2023-11-15 09:04:37 +02:00
parent 6565cc6355
commit 9178456a9f

View file

@ -183,11 +183,10 @@ auto VAbstractMainWindow::ContinueFormatRewrite(const QString &currentFormatVers
VAbstractApplication::VApp()->Settings()->SetConfirmFormatRewriting(not msgBox.isChecked()); VAbstractApplication::VApp()->Settings()->SetConfirmFormatRewriting(not msgBox.isChecked());
return true; return true;
} }
else
{
return false; return false;
} }
}
return true; return true;
} }
@ -242,7 +241,7 @@ void VAbstractMainWindow::UpdateRecentFileActions()
for (int i = 0; i < numRecentFiles; ++i) for (int i = 0; i < numRecentFiles; ++i)
{ {
const QString& recent = recentFiles.at(i); const QString &recent = recentFiles.at(i);
if (not recent.isEmpty()) if (not recent.isEmpty())
{ {
const QString text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i)); const QString text = QStringLiteral("&%1. %2").arg(i + 1).arg(recentFiles.at(i));
@ -395,18 +394,20 @@ void VAbstractMainWindow::ExportDataToCSV()
return; return;
} }
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
DialogExportToCSV dialog(this); DialogExportToCSV dialog(this);
dialog.SetWithHeader(VAbstractApplication::VApp()->Settings()->GetCSVWithHeader()); dialog.SetWithHeader(settings->GetCSVWithHeader());
dialog.SetSelectedMib(VAbstractApplication::VApp()->Settings()->GetCSVCodec()); dialog.SetSelectedMib(settings->GetCSVCodec());
dialog.SetSeparator(VAbstractApplication::VApp()->Settings()->GetCSVSeparator()); dialog.SetSeparator(settings->GetCSVSeparator());
if (dialog.exec() == QDialog::Accepted) if (dialog.exec() == QDialog::Accepted)
{ {
ExportToCSVData(fileName, dialog.IsWithHeader(), dialog.GetSelectedMib(), dialog.GetSeparator()); ExportToCSVData(fileName, dialog.IsWithHeader(), dialog.GetSelectedMib(), dialog.GetSeparator());
VAbstractApplication::VApp()->Settings()->SetCSVSeparator(dialog.GetSeparator()); settings->SetCSVSeparator(dialog.GetSeparator());
VAbstractApplication::VApp()->Settings()->SetCSVCodec(dialog.GetSelectedMib()); settings->SetCSVCodec(dialog.GetSelectedMib());
VAbstractApplication::VApp()->Settings()->SetCSVWithHeader(dialog.IsWithHeader()); settings->SetCSVWithHeader(dialog.IsWithHeader());
} }
} }