mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: move get_dc_nickname from qthelper.cpp to divecomputer.cpp
1) qthelper is already huge. 2) set_dc_nickname et al. is already there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3d4698c0a1
commit
9386eb2a0b
5 changed files with 13 additions and 14 deletions
|
|
@ -158,3 +158,13 @@ extern "C" void set_dc_nickname(struct dive *dive)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString get_dc_nickname(const struct divecomputer *dc)
|
||||
{
|
||||
const DiveComputerNode *existNode = dcList.getExact(dc->model, dc->deviceid);
|
||||
|
||||
if (existNode && !existNode->nickName.isEmpty())
|
||||
return existNode->nickName;
|
||||
else
|
||||
return dc->model;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public:
|
|||
QVector<DiveComputerNode> dcs;
|
||||
};
|
||||
|
||||
QString get_dc_nickname(const struct divecomputer *dc);
|
||||
extern DiveComputerList dcList;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "membuffer.h"
|
||||
#include "subsurfacesysinfo.h"
|
||||
#include "version.h"
|
||||
#include "divecomputer.h"
|
||||
#include "errorhelper.h"
|
||||
#include "planner.h"
|
||||
#include "time.h"
|
||||
|
|
@ -527,16 +526,6 @@ void set_filename(const char *filename)
|
|||
existing_filename = copy_string(filename);
|
||||
}
|
||||
|
||||
QString get_dc_nickname(const char *model, uint32_t deviceid)
|
||||
{
|
||||
const DiveComputerNode *existNode = dcList.getExact(model, deviceid);
|
||||
|
||||
if (existNode && !existNode->nickName.isEmpty())
|
||||
return existNode->nickName;
|
||||
else
|
||||
return model;
|
||||
}
|
||||
|
||||
QString get_depth_string(int mm, bool showunit, bool showdecimal)
|
||||
{
|
||||
if (prefs.units.length == units::METERS) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#ifndef QTHELPER_H
|
||||
#define QTHELPER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <libxslt/transform.h>
|
||||
#include <libxslt/xsltutils.h>
|
||||
#include "core/pref.h"
|
||||
|
|
@ -60,7 +59,6 @@ QString get_pressure_unit();
|
|||
QString getSubsurfaceDataPath(QString folderToFind);
|
||||
QString getPrintingTemplatePathUser();
|
||||
QString getPrintingTemplatePathBundle();
|
||||
QString get_dc_nickname(const char *model, uint32_t deviceid);
|
||||
int gettimezoneoffset(timestamp_t when = 0);
|
||||
int parseDurationToSeconds(const QString &text);
|
||||
int parseLengthToMm(const QString &text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue