subsurface/qt-models
Berthold Stoeger 32df0ab0da Cleanup: remove DiveItem and TripItem classes
The DiveItem and TripItem classes were wrappers around dive * and
dive_trip * used to extract tabular data. With the rework of
DiveTripModel they lost all their state besides the pointer itself.
The usage was:
	DiveItem item(d);
	item.data(...);
This can now be simplified to the much more idiomatic
	diveData(d, ...);
and analoguously for TripItem.

While adapting the data() function to be part of DiveTripModel, change
the
	QVariant ret
	switch(...) {
	...
	case ...:
		ret = ...;
		break;
	...
	}
	return ret;
style to
	switch(...) {
	...
	case ...:
		return ...;
	}
Not only is this shorter and easier to reason about, it generally also
improves the generated code. The compiler can directly construct the
return value in the buffer provided by the caller. Though modern
compilers start to be very good at avoiding unnecessary copies.

In total this cleanup results in a net-reduction of 190 lines of code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-14 15:57:14 -04:00
..
cleanertablemodel.cpp qt-models: Change Q_UNUSED to no parameter name 2018-05-21 12:48:04 -07:00
cleanertablemodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
CMakeLists.txt Cleanup: Remove SsrfFilterSortProxyModel 2018-10-11 16:25:32 -07:00
completionmodels.cpp Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
completionmodels.h Add SPDX header to Qt models 2017-04-29 13:32:55 -07:00
cylindermodel.cpp Cleanup: pass gasmix by value 2018-08-23 05:16:38 -07:00
cylindermodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
divecomputerextradatamodel.cpp qt-models: Change Q_UNUSED to no parameter name 2018-05-21 12:48:04 -07:00
divecomputerextradatamodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
divecomputermodel.cpp Dive computers: turn QMultiMap into sorted vector 2018-06-17 06:53:13 +09:00
divecomputermodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
diveimportedmodel.cpp Autogroup only when selected 2018-10-14 09:22:56 +02:00
diveimportedmodel.h Core: remove dive.h from files that don't need it 2018-05-14 10:13:39 -07:00
divelistmodel.cpp QML UI: correctly update the model 2018-06-25 20:20:35 +08:00
divelistmodel.h Cleanup: fold core/helpers.h into core/qthelper.h 2018-06-04 08:50:10 -07:00
divelocationmodel.cpp Map: remove access to displayed_dive_site in GPS-filter model 2018-10-11 16:25:32 -07:00
divelocationmodel.h Cleanup: Remove SsrfFilterSortProxyModel 2018-10-11 16:25:32 -07:00
divepicturemodel.cpp Dive media: put duration on video thumbnails 2018-07-28 15:31:25 -07:00
divepicturemodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
diveplannermodel.cpp Undo: make adding of planned dive undo-able 2018-10-11 16:22:27 -07:00
diveplannermodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
diveplotdatamodel.cpp qt-models: Change Q_UNUSED to no parameter name 2018-05-21 12:48:04 -07:00
diveplotdatamodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
divetripmodel.cpp Cleanup: remove DiveItem and TripItem classes 2018-10-14 15:57:14 -04:00
divetripmodel.h Cleanup: remove DiveItem and TripItem classes 2018-10-14 15:57:14 -04:00
filtermodels.cpp Cleanup: rename MainWindow member variables 2018-10-13 21:42:53 -04:00
filtermodels.h Filter: reload only when checkstate changed 2018-10-11 16:22:27 -07:00
gpslistmodel.cpp Cleanup: fold core/helpers.h into core/qthelper.h 2018-06-04 08:50:10 -07:00
gpslistmodel.h Unused code: GpsListModel::addGpsFix() 2018-01-10 16:45:42 +01:00
maplocationmodel.cpp qt-models: Change Q_UNUSED to no parameter name 2018-05-21 12:48:04 -07:00
maplocationmodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
messagehandlermodel.cpp qt-models: Change Q_UNUSED to no parameter name 2018-05-21 12:48:04 -07:00
messagehandlermodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
models.cpp Change from gettextFromC::instance()->tr() to gettextFromC::tr(); 2018-06-18 07:42:39 +02:00
models.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
tankinfomodel.cpp equipment: sanitize 'tank_info' loop limits 2018-06-20 09:30:58 +09:00
tankinfomodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
treemodel.cpp Cleanup: make DiveTripModel a global object 2018-09-01 07:48:43 -07:00
treemodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
weightmodel.cpp equipment: sanitize 'ws_info' loop limits 2018-06-20 09:30:58 +09:00
weightmodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
weightsysteminfomodel.cpp equipment: sanitize 'ws_info' loop limits 2018-06-20 09:30:58 +09:00
weightsysteminfomodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
yearlystatisticsmodel.cpp Statistics: only consider selected dives in HTML export statistics 2018-10-07 17:50:51 +03:00
yearlystatisticsmodel.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00