[PATCH 3/3] Pre-configured imports in Import Dive Log File -> CSV should also be cleared when the field separator is set

Tomaz Canabrava tcanabrava at kde.org
Tue Jan 14 04:05:27 UTC 2014


On Mon, Jan 13, 2014 at 10:11 PM, Rodrigo Severo <
rodrigo at fabricadeideias.com> wrote:

> Pre-configured imports in Import Dive Log File for CSV files should also
> be cleared when the field separator
> is changed by the user.
> Signed-off-by:Rodrigo Severo <rodrigo at fabricadeideias.com>
> ---
>  qt-ui/divelogimportdialog.cpp | 6 ++++++
>  qt-ui/divelogimportdialog.h   | 1 +
>  2 files changed, 7 insertions(+)
>
> diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
> index ebf7508..765690a 100644
> --- a/qt-ui/divelogimportdialog.cpp
> +++ b/qt-ui/divelogimportdialog.cpp
> @@ -37,6 +37,7 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList
> *fn, QWidget *parent) :
>         connect(ui->cnsCheckBox, SIGNAL(clicked(bool)), this,
> SLOT(unknownImports(bool)));
>         connect(ui->CSVstopdepth, SIGNAL(valueChanged(int)), this,
> SLOT(unknownImports(int)));
>         connect(ui->stopdepthCheckBox, SIGNAL(clicked(bool)), this,
> SLOT(unknownImports(bool)));
> +        connect(ui->CSVSeparator, SIGNAL(currentIndexChanged(const
> QString&)), this, SLOT(unknownImports(const QString&)));
>  }
>
>  DiveLogImportDialog::~DiveLogImportDialog()
> @@ -107,6 +108,11 @@ void DiveLogImportDialog::unknownImports(int arg1)
>         unknownImports();
>  }
>
> +void DiveLogImportDialog::unknownImports(const QString & arg1)
> +{
> +       unknownImports();
> +}
> +
>  void DiveLogImportDialog::unknownImports()
>  {
>         ui->knownImports->setCurrentIndex(0);
> diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h
> index d8cedab..87563f4 100644
> --- a/qt-ui/divelogimportdialog.h
> +++ b/qt-ui/divelogimportdialog.h
> @@ -23,6 +23,7 @@ private slots:
>         void on_knownImports_currentIndexChanged(int index);
>         void unknownImports(int);
>         void unknownImports(bool);
> +        void unknownImports(const QString &);
>

Didn't liked it.
Why not promote unknownImports() to a slot, remove the unknownImports(const
QString& ) and connect like this:
connect(ui->CSVSeparator, SIGNAL(currentIndexChanged(const QString&)),
this, SLOT(unknownImports()));

 The signal parameters doesn't need to exists on the Slots parameters, this
simplifies code since the only thing you are doing on the const QString&
arg1 version is to call the one without string.


>  private:
>         void unknownImports();
> --
> 1.8.3.2
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140114/448f3d68/attachment.html>


More information about the subsurface mailing list