aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-24 09:59:48 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-24 07:24:11 -0800
commit28740708701f5f082ccac98964573ce028daf4b7 (patch)
treef85220d0cde9fd5fbf73455957be1df813edeb34
parent231fd2e6e04009c6e895dffb0567d76418119b53 (diff)
downloadsubsurface-28740708701f5f082ccac98964573ce028daf4b7.tar.gz
Code cleanup. Don't use if ( true ) set (false).
Code cleanup, don't use if ( thing() ) set false, but set !thing() instead. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/csvimportdialog.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/qt-ui/csvimportdialog.cpp b/qt-ui/csvimportdialog.cpp
index 3182d9c31..690640222 100644
--- a/qt-ui/csvimportdialog.cpp
+++ b/qt-ui/csvimportdialog.cpp
@@ -56,7 +56,6 @@ void CSVImportDialog::on_buttonBox_accepted()
ui->CSVSeparator->currentIndex(),
&error);
if (error != NULL) {
-
mainWindow()->showError(error);
free(error);
error = NULL;
@@ -70,10 +69,7 @@ void CSVImportDialog::on_CSVFileSelector_clicked()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Open CSV Log File"), ".", tr("CSV Files (*.csv);;All Files(*)"));
ui->CSVFile->setText(filename);
- if (filename.isEmpty())
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
- else
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!filename.isEmpty());
}
#define SET_VALUE_AND_CHECKBOX(CSV, BOX, VAL) ({\
@@ -117,8 +113,5 @@ void CSVImportDialog::unknownImports()
void CSVImportDialog::on_CSVFile_textEdited()
{
- if (ui->CSVFile->text().isEmpty())
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
- else
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!ui->CSVFile->text().isEmpty());
}