Changeset 93763f31 in subsurface


Ignore:
Timestamp:
Feb 15, 2017, 9:47:46 PM (5 days ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
c5b9cfc
Parents:
83aff9f
git-author:
Stefan Fuchs <sfuchs@…> (02/15/17 14:15:08)
git-committer:
Dirk Hohndel <dirk@…> (02/15/17 21:47:46)
Message:

Always use emitDataChanged() in diveplannermodel.cpp

Use the function in every place instead of once using it and once copying the code again.
No functional change.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/diveplannermodel.cpp

    r2516ae7e r93763f31  
    322322        while (i < rowCount() && oldcylinderid == divepoints[i].cylinderid)
    323323                divepoints[i++].cylinderid = newcylinderid;
    324         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     324        emitDataChanged();
    325325}
    326326
     
    386386        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    387387        planner->setBottomSac(diveplan.bottomsac);
    388         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     388        emitDataChanged();
    389389}
    390390
     
    394394        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    395395        planner->setDecoSac(diveplan.decosac);
    396         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     396        emitDataChanged();
    397397}
    398398
     
    448448{
    449449        diveplan.surface_pressure = pressure;
    450         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     450        emitDataChanged();
    451451}
    452452
     
    454454{
    455455        diveplan.salinity = salinity;
    456         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     456        emitDataChanged();
    457457}
    458458
     
    466466        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    467467        planner->setLastStop(value);
    468         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     468        emitDataChanged();
    469469}
    470470
     
    473473        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    474474        planner->setVerbatimPlan(value);
    475         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     475        emitDataChanged();
    476476}
    477477
     
    480480        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    481481        planner->setDisplayRuntime(value);
    482         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     482        emitDataChanged();
    483483}
    484484
     
    487487        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    488488        planner->setDisplayDuration(value);
    489         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     489        emitDataChanged();
    490490}
    491491
     
    494494        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    495495        planner->setDisplayTransitions(value);
    496         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     496        emitDataChanged();
    497497}
    498498
     
    519519        else
    520520                planner->setReserveGas(psi_to_mbar(reserve));
    521         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     521        emitDataChanged();
    522522}
    523523
     
    542542                endInsertRows();
    543543        }
    544         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     544        emitDataChanged();
    545545}
    546546
     
    549549        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    550550        planner->setSwitchAtRequiredStop(value);
    551         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     551        emitDataChanged();
    552552}
    553553
     
    556556        auto planner = SettingsObjectWrapper::instance()->planner_settings;
    557557        planner->setMinSwitchDuration(duration * 60);
    558         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     558        emitDataChanged();
    559559}
    560560
     
    564564        diveplan.when = startTime.toTime_t();
    565565        displayed_dive.when = diveplan.when;
    566         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     566        emitDataChanged();
    567567}
    568568
     
    572572                diveplan.when = startTime.toTime_t();
    573573        displayed_dive.when = diveplan.when;
    574         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     574        emitDataChanged();
    575575}
    576576
     
    668668        if (updateMaxDepth())
    669669                CylindersModel::instance()->updateBestMixes();
    670         emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
     670        emitDataChanged();
    671671}
    672672
Note: See TracChangeset for help on using the changeset viewer.