[PATCH 2/2] HTML: Fix Null values in yearly statistics export.

Gehad Elrobey gehadelrobey at gmail.com
Sun Feb 8 23:42:39 PST 2015


it seems that my mail client messed them up. Patches reattached.

regards,
Gehad

On Mon, Feb 9, 2015 at 3:34 AM, Dirk Hohndel <dirk at hohndel.org> wrote:

> Even though this was sent as an attachment, it's still completely
> whitespace damaged & word wrapped.
>
> I know you've sent me many good patches in the past, so I'm not sure what
> went wrong here...
>
> /D
>
> On Sun, Feb 08, 2015 at 11:38:38PM +0200, Gehad Elrobey wrote:
> > Null values should be handeled nicely instead of showing NULL or Nan.
> >
> > Signed-off-by: Gehad elrobey <gehadelrobey at gmail.com>
> > ---
> >  qt-ui/divelogexportdialog.cpp | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/qt-ui/divelogexportdialog.cpp
> b/qt-ui/divelogexportdialog.cpp
> > index b672601..43c4155 100644
> > --- a/qt-ui/divelogexportdialog.cpp
> > +++ b/qt-ui/divelogexportdialog.cpp
> > @@ -201,9 +201,12 @@ void DiveLogExportDialog::exportHTMLstatistics(const
> > QString &filename)
> >   out << "\"AVG_SAC\":\"" << get_volume_string(stats_yearly[i].avg_sac)
> <<
> > "\",";
> >   out << "\"MIN_SAC\":\"" << get_volume_string(stats_yearly[i].min_sac)
> <<
> > "\",";
> >   out << "\"MAX_SAC\":\"" << get_volume_string(stats_yearly[i].max_sac)
> <<
> > "\",";
> > - out << "\"AVG_TEMP\":\"" <<
> QString::number(stats_yearly[i].combined_temp
> > / stats_yearly[i].combined_count, 'f', 1) << "\",";
> > - out << "\"MIN_TEMP\":\"" << get_temp_units(stats_yearly[i].min_temp,
> > NULL) << "\",";
> > - out << "\"MAX_TEMP\":\"" << get_temp_units(stats_yearly[i].max_temp,
> > NULL) << "\",";
> > + if ( stats_yearly[i].combined_count )
> > + out << "\"AVG_TEMP\":\"" <<
> QString::number(stats_yearly[i].combined_temp
> > / stats_yearly[i].combined_count, 'f', 1) << "\",";
> > + else
> > + out << "\"AVG_TEMP\":\"0.0\",";
> > + out << "\"MIN_TEMP\":\"" << ( stats_yearly[i].min_temp == 0 ? 0 :
> > get_temp_units(stats_yearly[i].min_temp, NULL)) << "\",";
> > + out << "\"MAX_TEMP\":\"" << ( stats_yearly[i].max_temp == 0 ? 0 :
> > get_temp_units(stats_yearly[i].max_temp, NULL)) << "\",";
> >   out << "},";
> >   total_stats.selection_size += stats_yearly[i].selection_size;
> >   total_stats.total_time.seconds += stats_yearly[i].total_time.seconds;
> > --
> > 1.9.1
>
> > _______________________________________________
> > subsurface mailing list
> > subsurface at subsurface-divelog.org
> > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150209/c5ce7b71/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-HTML-Fix-Null-values-in-yearly-statistics-export.patch
Type: text/x-patch
Size: 1923 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150209/c5ce7b71/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-HTML-Fix-exporting-themes-in-multilingual-environmen.patch
Type: text/x-patch
Size: 1369 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150209/c5ce7b71/attachment-0001.bin>


More information about the subsurface mailing list