Changeset 9357341 in subsurface


Ignore:
Timestamp:
Jan 6, 2017, 8:43:23 PM (7 weeks ago)
Author:
Subsurface <dirk@…>
Branches:
master
Children:
aaa46c2
Parents:
bb4bf63
git-author:
Robert C. Helling <helling@…> (01/06/17 18:11:19)
git-committer:
Subsurface <dirk@…> (01/06/17 20:43:23)
Message:

Rename prefs.deco_mode to prefs.planner_deco_mode

This is to avoid confusion with planner.display_deco_mode.
When accessing the "current deco mode" use the decoMode()
helper function.

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

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • core/pref.h

    r37e3e7e6 r9357341  
    144144        bool cloud_background_sync;
    145145        geocoding_prefs_t geocoding;
    146         enum deco_mode deco_mode;
     146        enum deco_mode planner_deco_mode;
    147147        short vpmb_conservatism;
    148148        int time_threshold;
  • core/qthelper.cpp

    rbb4bf63 r9357341  
    14401440extern "C" enum deco_mode decoMode()
    14411441{
    1442         return in_planner() ? prefs.deco_mode : prefs.display_deco_mode;
     1442        return in_planner() ? prefs.planner_deco_mode : prefs.display_deco_mode;
    14431443}
    14441444
  • core/subsurface-qt/SettingsObjectWrapper.cpp

    r37e3e7e6 r9357341  
    320320bool TechnicalDetailsSettings::buehlmann() const
    321321{
    322         return (prefs.deco_mode == BUEHLMANN);
     322        return (prefs.planner_deco_mode == BUEHLMANN);
    323323}
    324324
     
    525525void TechnicalDetailsSettings::setBuehlmann(bool value)
    526526{
    527         if (value == (prefs.deco_mode == BUEHLMANN))
     527        if (value == (prefs.planner_deco_mode == BUEHLMANN))
    528528                return;
    529529        QSettings s;
    530530        s.beginGroup(group);
    531531        s.setValue("buehlmann", value);
    532         prefs.deco_mode = value ? BUEHLMANN : VPMB;
     532        prefs.planner_deco_mode = value ? BUEHLMANN : VPMB;
    533533        emit buehlmannChanged(value);
    534534}
     
    12781278deco_mode DivePlannerSettings::decoMode() const
    12791279{
    1280         return prefs.deco_mode;
     1280        return prefs.planner_deco_mode;
    12811281}
    12821282
     
    15281528void DivePlannerSettings::setDecoMode(deco_mode value)
    15291529{
    1530         if (value == prefs.deco_mode)
     1530        if (value == prefs.planner_deco_mode)
    15311531                return;
    15321532
     
    15341534        s.beginGroup(group);
    15351535        s.setValue("deco_mode", value);
    1536         prefs.deco_mode = value;
     1536        prefs.planner_deco_mode = value;
    15371537        emit decoModeChanged(value);
    15381538}
     
    22872287        GET_INT("decosac", decosac);
    22882288
    2289         prefs.deco_mode = deco_mode(s.value("deco_mode", default_prefs.deco_mode).toInt());
     2289        prefs.planner_deco_mode = deco_mode(s.value("deco_mode", default_prefs.planner_deco_mode).toInt());
    22902290        s.endGroup();
    22912291
     
    23412341        s.setValue("bottomsac", prefs.bottomsac);
    23422342        s.setValue("decosac", prefs.decosac);
    2343         s.setValue("deco_mode", int(prefs.deco_mode));
     2343        s.setValue("deco_mode", int(prefs.planner_deco_mode));
    23442344        s.endGroup();
    23452345}
  • core/subsurfacestartup.c

    rce8f621 r9357341  
    8787                .use_system_language = true,
    8888        },
    89         .deco_mode = BUEHLMANN,
     89        .planner_deco_mode = BUEHLMANN,
    9090        .vpmb_conservatism = 3,
    9191        .distance_threshold = 1000,
  • desktop-widgets/diveplanner.cpp

    rfb2ba72 r9357341  
    304304        ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop);
    305305        ui.min_switch_duration->setValue(prefs.min_switch_duration / 60);
    306         ui.recreational_deco->setChecked(prefs.deco_mode == RECREATIONAL);
    307         ui.buehlmann_deco->setChecked(prefs.deco_mode == BUEHLMANN);
    308         ui.vpmb_deco->setChecked(prefs.deco_mode == VPMB);
    309         disableDecoElements((int) prefs.deco_mode);
     306        ui.recreational_deco->setChecked(prefs.planner_deco_mode == RECREATIONAL);
     307        ui.buehlmann_deco->setChecked(prefs.planner_deco_mode == BUEHLMANN);
     308        ui.vpmb_deco->setChecked(prefs.planner_deco_mode == VPMB);
     309        disableDecoElements((int) prefs.planner_deco_mode);
    310310
    311311        // should be the same order as in dive_comp_type!
  • qt-models/diveplannermodel.cpp

    r05098f9 r9357341  
    486486void DivePlannerPointsModel::setDecoMode(int mode)
    487487{
    488         prefs.deco_mode = deco_mode(mode);
    489         emit recreationChanged(mode == int(prefs.deco_mode));
     488        prefs.planner_deco_mode = deco_mode(mode);
     489        emit recreationChanged(mode == int(prefs.planner_deco_mode));
    490490        emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1));
    491491}
  • tests/testplan.cpp

    r7b89190 r9357341  
    3333        prefs.descrate = 99000 / 60;
    3434        prefs.last_stop = false;
    35         prefs.deco_mode = VPMB;
     35        prefs.planner_deco_mode = VPMB;
    3636        prefs.vpmb_conservatism = 0;
    3737}
     
    285285        prefs.unit_system = METRIC;
    286286        prefs.units.length = units::METERS;
    287         prefs.deco_mode = BUEHLMANN;
     287        prefs.planner_deco_mode = BUEHLMANN;
    288288
    289289        struct diveplan testPlan = {};
     
    321321        prefs.unit_system = IMPERIAL;
    322322        prefs.units.length = units::FEET;
    323         prefs.deco_mode = BUEHLMANN;
     323        prefs.planner_deco_mode = BUEHLMANN;
    324324
    325325        struct diveplan testPlan = {};
Note: See TracChangeset for help on using the changeset viewer.