diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-04-29 21:19:26 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-05-06 08:21:04 -0700 |
commit | 573de51e48c71c1acff87a9a44841f0a2068eb9c (patch) | |
tree | 17fa5b59db36b2a36aecec726bb4def246e0ec82 /desktop-widgets | |
parent | c34f0b88a255401a5603413e59656cf4fe4967ca (diff) | |
download | subsurface-573de51e48c71c1acff87a9a44841f0a2068eb9c.tar.gz |
export: remove redundant QString::isNull() checks
If QString::isEmpty() is false, QString::isNull() is likewise
false, so these tests are redundant.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index a685fb414..f0ee82337 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -161,12 +161,12 @@ void DiveLogExportDialog::on_buttonBox_accepted() } else if (ui->exportWorldMap->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Export world map"), lastDir, tr("HTML files") + " (*.html)"); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) export_worldmap_HTML(qPrintable(filename), ui->exportSelected->isChecked()); } else if (ui->exportSubsurfaceXML->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Export Subsurface XML"), lastDir, tr("Subsurface files") + " (*.ssrf *.xml)"); - if (!filename.isNull() && !filename.isEmpty()) { + if (!filename.isEmpty()) { if (!filename.contains('.')) filename.append(".ssrf"); QByteArray bt = QFile::encodeName(filename); @@ -175,7 +175,7 @@ void DiveLogExportDialog::on_buttonBox_accepted() } else if (ui->exportSubsurfaceSitesXML->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Export Subsurface dive sites XML"), lastDir, tr("Subsurface files") + " (*.xml)"); - if (!filename.isNull() && !filename.isEmpty()) { + if (!filename.isEmpty()) { if (!filename.contains('.')) filename.append(".xml"); QByteArray bt = QFile::encodeName(filename); @@ -184,31 +184,31 @@ void DiveLogExportDialog::on_buttonBox_accepted() } } else if (ui->exportImageDepths->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Save image depths"), lastDir); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) export_depths(qPrintable(filename), ui->exportSelected->isChecked()); } else if (ui->exportTeX->isChecked() || ui->exportLaTeX->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Export to TeX file"), lastDir, tr("TeX files") + " (*.tex)"); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) export_TeX(qPrintable(filename), ui->exportSelected->isChecked(), ui->exportTeX->isChecked()); } else if (ui->exportProfile->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Save profile image"), lastDir); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) exportProfile(qPrintable(filename), ui->exportSelected->isChecked()); } else if (ui->exportProfileData->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Save profile data"), lastDir); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) save_profiledata(qPrintable(filename), ui->exportSelected->isChecked()); } break; case 1: filename = QFileDialog::getSaveFileName(this, tr("Export HTML files as"), lastDir, tr("HTML files") + " (*.html)"); - if (!filename.isNull() && !filename.isEmpty()) + if (!filename.isEmpty()) exportHtmlInit(filename); break; } - if (!filename.isNull() && !filename.isEmpty()) { + if (!filename.isEmpty()) { // remember the last export path QFileInfo fileInfo(filename); qPrefDisplay::set_lastDir(fileInfo.dir().path()); |