mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
231fd2e6e0
commit
2874070870
1 changed files with 2 additions and 9 deletions
|
@ -56,7 +56,6 @@ void CSVImportDialog::on_buttonBox_accepted()
|
||||||
ui->CSVSeparator->currentIndex(),
|
ui->CSVSeparator->currentIndex(),
|
||||||
&error);
|
&error);
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
|
|
||||||
mainWindow()->showError(error);
|
mainWindow()->showError(error);
|
||||||
free(error);
|
free(error);
|
||||||
error = NULL;
|
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(*)"));
|
QString filename = QFileDialog::getOpenFileName(this, tr("Open CSV Log File"), ".", tr("CSV Files (*.csv);;All Files(*)"));
|
||||||
ui->CSVFile->setText(filename);
|
ui->CSVFile->setText(filename);
|
||||||
if (filename.isEmpty())
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!filename.isEmpty());
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
|
||||||
else
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SET_VALUE_AND_CHECKBOX(CSV, BOX, VAL) ({\
|
#define SET_VALUE_AND_CHECKBOX(CSV, BOX, VAL) ({\
|
||||||
|
@ -117,8 +113,5 @@ void CSVImportDialog::unknownImports()
|
||||||
|
|
||||||
void CSVImportDialog::on_CSVFile_textEdited()
|
void CSVImportDialog::on_CSVFile_textEdited()
|
||||||
{
|
{
|
||||||
if (ui->CSVFile->text().isEmpty())
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!ui->CSVFile->text().isEmpty());
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
|
||||||
else
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue