Changeset eefa390 in subsurface


Ignore:
Timestamp:
Mar 28, 2017, 1:31:45 PM (8 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
d344779c
Parents:
622ab22
git-author:
Robert C. Helling <helling@…> (03/27/17 09:30:05)
git-committer:
Dirk Hohndel <dirk@…> (03/28/17 13:31:45)
Message:

Handle notes in replan

Upon replanning a dive, we want to delete the old
dive plan in the notes and replace it with the actual.

This fixes a problem when we failed to detect the old plan due
to the deco model name appearing in the disclaimer that was used
as a marker for the notes.

This patch also adds translation markers for the deco model name strings..

Fixes #285

Signed-off-by: Robert C. Helling <helling@…>

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/planner.c

    r6f21d27 reefa390  
    4242pressure_t first_ceiling_pressure, max_bottom_ceiling_pressure = {};
    4343
    44 const char *disclaimer;
     44char *disclaimer;
    4545int plot_depth = 0;
    4646#if DEBUG_PLAN
     
    556556
    557557        if (decoMode() == VPMB) {
    558                 deco = "VPM-B";
     558                deco = translate("gettextFromC", "VPM-B");
    559559        } else {
    560                 deco = "BUHLMANN";
     560                deco = translate("gettextFromC", "BUHLMANN");
    561561        }
    562562
  • core/planner.h

    rb1ed04a reefa390  
    2525extern struct dive *planned_dive;
    2626extern char *cache_data;
    27 extern const char *disclaimer;
     27extern char *disclaimer;
    2828extern double plangflow, plangfhigh;
    2929
  • qt-models/diveplannermodel.cpp

    r8834fc0 reefa390  
    895895                        record_dive(copy);
    896896                        QString oldnotes(current_dive->notes);
    897                         if (oldnotes.indexOf(QString(disclaimer)) >= 0)
    898                                 oldnotes.truncate(oldnotes.indexOf(QString(disclaimer)));
     897                        if (oldnotes.indexOf(QString(disclaimer).left(40)) >= 0)
     898                                oldnotes.truncate(oldnotes.indexOf(QString(displayed_dive.notes).left(40)));
    899899                        if (did_deco)
    900900                                oldnotes.append(displayed_dive.notes);
Note: See TracChangeset for help on using the changeset viewer.