Changeset e6d884c in subsurface for qt-models


Ignore:
Timestamp:
May 26, 2017, 3:50:52 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
bb6ceba
Parents:
53a8075
git-author:
Stefan Fuchs <sfuchs@…> (05/11/17 13:43:36)
git-committer:
Dirk Hohndel <dirk@…> (05/26/17 15:50:52)
Message:

Creation of dive duration string and surface interval string

Update the function to create the dive duration string in a way that
it can be used also in info and stats tab and added some more flexibility.

Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min"
(with units and :) or "5min 35sec" (with units with space).

Add a new function to create the surface interval string.

Completely remove old function get_time_string() and get_time_string_s().

Signed-off-by: Stefan Fuchs <sfuchs@…>

Location:
qt-models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qt-models/divetripmodel.cpp

    r92d24a2 re6d884c  
    344344{
    345345        struct dive *dive = get_dive_by_uniq_id(diveId);
    346         return get_dive_duration_string(dive->duration.seconds, ":", "m", "s", dive->dc.divemode == FREEDIVE);
     346        return get_dive_duration_string(dive->duration.seconds, "", "", "", ":", dive->dc.divemode == FREEDIVE);
     347        // Next line is test for alternative display with units
     348        // return get_dive_duration_string(dive->duration.seconds, tr("h"), tr("min"), "", ":", dive->dc.divemode == FREEDIVE);
    347349}
    348350
  • qt-models/yearlystatisticsmodel.cpp

    r5372f12 re6d884c  
    6262                break;
    6363        case TOTAL_TIME:
    64                 ret = get_time_string(stats_interval.total_time.seconds, 0);
     64                ret = get_dive_duration_string(stats_interval.total_time.seconds, tr("h"), tr("min"), tr("sec"), " ");
    6565                break;
    6666        case AVERAGE_TIME:
Note: See TracChangeset for help on using the changeset viewer.