mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn C dive-table into an owning table
This is a humongous commit, because it touches all parts of the code. It removes the last user of our horrible TABLE macros, which simulate std::vector<> in a very clumsy way. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f00c30ad4a
commit
b95ac3f79c
73 changed files with 1030 additions and 1230 deletions
21
core/triptable.h
Normal file
21
core/triptable.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef TRIPTABLE_H
|
||||
#define TRIPTABLE_H
|
||||
|
||||
#include "owning_table.h"
|
||||
|
||||
struct dive_trip;
|
||||
|
||||
int comp_trips(const dive_trip &t1, const dive_trip &t2);
|
||||
|
||||
struct trip_table : public sorted_owning_table<dive_trip, &comp_trips> {
|
||||
dive_trip *get_by_uniq_id(int tripId) const;
|
||||
};
|
||||
|
||||
/* Make pointers to trip_table "Qt metatypes" so that they can be
|
||||
* passed through QVariants and through QML. See comment in dive.h. */
|
||||
#include <QObject>
|
||||
Q_DECLARE_METATYPE(trip_table *);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue