Changeset c9c9b1b3 in subsurface


Ignore:
Timestamp:
Apr 6, 2017, 6:29:11 PM (4 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
6afcbee
Parents:
385816b
git-author:
Stefan Fuchs <sfuchs@…> (03/30/17 23:14:36)
git-committer:
Dirk Hohndel <dirk@…> (04/06/17 18:29:11)
Message:

Add creation date and Subsurface version to planner output

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

Location:
core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/planner.c

    r1b744c76 rc9c9b1b3  
    1616#include "libdivecomputer/parser.h"
    1717#include "qthelperfromc.h"
     18#include "version.h"
    1819
    1920#define TIMESTEP 2 /* second */
     
    6768}
    6869#endif
     70
     71/* this is in qthelper.cpp, so including the .h file is a pain */
     72extern const char *get_current_date();
    6973
    7074bool diveplan_empty(struct diveplan *diveplan)
     
    838842        int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit);
    839843
    840         len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br></div>"),
     844        len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br>"),
    841845                        diveplan->surface_pressure,
    842846                        altitude,
    843847                        depth_unit);
     848
     849        len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Plan creation date and version: %s, %s<br></div>"),
     850                        get_current_date(), subsurface_canonical_version());
    844851
    845852        /* Get SAC values and units for printing it in gas consumption */
  • core/qthelper.cpp

    r597539c rc9c9b1b3  
    960960}
    961961
     962extern "C" const char *get_current_date()
     963{
     964        QDateTime ts(QDateTime::currentDateTime());;
     965        QString current_date;
     966       
     967        current_date = loc.toString(ts, QString(prefs.date_format_short));
     968
     969        return strdup(current_date.toUtf8().data());
     970}
     971
    962972bool is_same_day(timestamp_t trip_when, timestamp_t dive_when)
    963973{
  • core/qthelper.h

    rdbd99f7 rc9c9b1b3  
    1717bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed_out = 0);
    1818extern "C" const char *printGPSCoords(int lat, int lon);
     19extern "C" const char *get_current_date();
    1920QList<int> getDivesInTrip(dive_trip_t *trip);
    2021QString get_gas_string(struct gasmix gas);
Note: See TracChangeset for help on using the changeset viewer.