mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
eb9d6d0f94
The existing code took an odd approach. It tried to change all selected dives whenever the user edited a field, and kept all this backup data in case the user rejected the edits. This code takes the opposite approach. Only edit a copy of the selected dive and then when the user accepts it, edit all the dives and when the user rejects the edit simply redraw the screen (as all the "real" data is still unchanged). This not only saves quite a bit of code, it should be much easier to get correct. Admitedly this code will need quite a bit more testing to make sure it works as intended, but as far as I can tell it already gets more scenarios right than the previous implementation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
19 lines
551 B
C
19 lines
551 B
C
#ifndef QTHELPER_H
|
|
#define QTHELPER_H
|
|
|
|
#include <QMultiMap>
|
|
#include <QString>
|
|
#include <stdint.h>
|
|
#include "dive.h"
|
|
#include "divelist.h"
|
|
#include <QTranslator>
|
|
|
|
// global pointers for our translation
|
|
extern QTranslator *qtTranslator, *ssrfTranslator;
|
|
|
|
QString weight_string(int weight_in_grams);
|
|
bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed_out = 0);
|
|
QString printGPSCoords(int lat, int lon);
|
|
QList<int> getDivesInTrip(dive_trip_t *trip);
|
|
QString gasToStr(struct gasmix gas);
|
|
#endif // QTHELPER_H
|