From f9ceff009b35f73dec6d13f4037119172f6cf0de Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 17 Jan 2015 22:43:52 +1300 Subject: Clean up the header files Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel --- qt-ui/configuredivecomputerdialog.cpp | 7 ------- qt-ui/divecomputermanagementdialog.cpp | 2 -- qt-ui/divelistview.cpp | 21 +-------------------- qt-ui/divelogexportdialog.cpp | 8 -------- qt-ui/divelogimportdialog.cpp | 8 +------- qt-ui/divepicturewidget.cpp | 6 ++---- qt-ui/diveplanner.cpp | 17 ----------------- qt-ui/diveshareexportdialog.cpp | 5 ++--- qt-ui/downloadfromdivecomputer.cpp | 8 -------- qt-ui/filtermodels.cpp | 3 --- qt-ui/globe.cpp | 11 +---------- qt-ui/groupedlineedit.cpp | 10 ---------- qt-ui/kmessagewidget.cpp | 1 - qt-ui/maintab.cpp | 16 ++-------------- qt-ui/mainwindow.cpp | 25 ------------------------- qt-ui/modeldelegates.cpp | 17 ----------------- qt-ui/preferences.cpp | 1 - qt-ui/printdialog.cpp | 6 ------ qt-ui/printlayout.cpp | 9 --------- qt-ui/printoptions.cpp | 2 +- qt-ui/profile/animationfunctions.cpp | 2 -- qt-ui/profile/divecartesianaxis.cpp | 7 ------- qt-ui/profile/diveeventitem.cpp | 3 --- qt-ui/profile/divelineitem.cpp | 2 -- qt-ui/profile/divepixmapitem.cpp | 5 ----- qt-ui/profile/diveplotdatamodel.cpp | 2 -- qt-ui/profile/diveprofileitem.cpp | 9 --------- qt-ui/profile/divetextitem.cpp | 9 --------- qt-ui/profile/divetooltipitem.cpp | 6 ------ qt-ui/profile/profilewidget2.cpp | 11 ----------- qt-ui/profile/ruleritem.cpp | 11 ----------- qt-ui/profile/tankitem.cpp | 2 -- qt-ui/simplewidgets.cpp | 19 +------------------ qt-ui/starwidget.cpp | 6 ------ qt-ui/subsurfacewebservices.cpp | 9 --------- qt-ui/tableview.cpp | 4 ---- qt-ui/tagwidget.cpp | 6 +----- qt-ui/updatemanager.cpp | 1 - qt-ui/usermanual.cpp | 1 - qt-ui/usersurvey.cpp | 1 - 40 files changed, 12 insertions(+), 287 deletions(-) diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 6b50cdadb..bc9ff5e2f 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -1,17 +1,10 @@ #include "configuredivecomputerdialog.h" -#include "divecomputer.h" -#include "libdivecomputer.h" #include "helpers.h" -#include "display.h" -#include "divelist.h" -#include "configuredivecomputer.h" #include "mainwindow.h" #include #include #include -#include -#include #include struct product { diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index 567abd4d7..742facdcb 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -1,7 +1,5 @@ #include "divecomputermanagementdialog.h" -#include "models.h" #include "mainwindow.h" -#include "qthelper.h" #include "helpers.h" #include #include diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index d6f52c646..d4e744237 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -5,31 +5,12 @@ * */ #include "divelistview.h" -#include "models.h" #include "filtermodels.h" #include "modeldelegates.h" #include "mainwindow.h" -#include "subsurfacewebservices.h" -#include "divelogexportdialog.h" -#include "../display.h" -#include "exif.h" -#include "../file.h" -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include "socialnetworks.h" -#include "../qthelper.h" +#include "qthelper.h" // # Date Rtg Dpth Dur Tmp Wght Suit Cyl Gas SAC OTU CNS Loc static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500}; diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 8f5d720e3..0193ea5d9 100644 --- a/qt-ui/divelogexportdialog.cpp +++ b/qt-ui/divelogexportdialog.cpp @@ -1,21 +1,13 @@ #include -#include #include -#include -#include #include -#include -#include -#include "mainwindow.h" #include "divelogexportdialog.h" #include "diveshareexportdialog.h" #include "ui_divelogexportdialog.h" #include "subsurfacewebservices.h" #include "worldmap-save.h" #include "save-html.h" -#include "helpers.h" -#include "statistics.h" #define GET_UNIT(name, field, f, t) \ v = settings.value(QString(name)); \ diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 18020c9f1..681241a72 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -1,15 +1,9 @@ -#include -#include -#include #include "divelogimportdialog.h" #include "mainwindow.h" #include "ui_divelogimportdialog.h" -#include -#include -#include +#include #include #include -#include static QString subsurface_mimedata = "subsurface/csvcolumns"; static QString subsurface_index = "subsurface/csvindex"; diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index d42afefbf..92695b6a6 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -1,11 +1,9 @@ #include "divepicturewidget.h" #include "metrics.h" - -#include -#include +#include "dive.h" +#include "divelist.h" #include #include -#include DivePictureModel *DivePictureModel::instance() { diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index bf7af7fd1..44ca6baf5 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1,31 +1,14 @@ #include "diveplanner.h" -#include "graphicsview-common.h" -#include "models.h" #include "modeldelegates.h" #include "mainwindow.h" -#include "maintab.h" -#include "tableview.h" - -#include "dive.h" -#include "divelist.h" #include "planner.h" -#include "display.h" #include "helpers.h" -#include -#include #include #include -#include -#include #include -#include -#include #include -#include -#include - #define TIME_INITIAL_MAX 30 #define MAX_DEPTH M_OR_FT(150, 450) diff --git a/qt-ui/diveshareexportdialog.cpp b/qt-ui/diveshareexportdialog.cpp index 8f817ae63..3ce2e0bb4 100644 --- a/qt-ui/diveshareexportdialog.cpp +++ b/qt-ui/diveshareexportdialog.cpp @@ -2,11 +2,10 @@ #include "ui_diveshareexportdialog.h" #include "mainwindow.h" #include "save-html.h" -#include "qt-ui/usersurvey.h" -#include "qt-ui/subsurfacewebservices.h" +#include "usersurvey.h" +#include "subsurfacewebservices.h" #include -#include #include DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) : diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index f382e0b2b..c66792550 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -1,15 +1,7 @@ #include "downloadfromdivecomputer.h" -#include "divecomputer.h" -#include "libdivecomputer.h" #include "helpers.h" -#include "display.h" -#include "divelist.h" #include "mainwindow.h" -#include -#include -#include -#include #include #include #include diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp index aaace6586..e2597a634 100644 --- a/qt-ui/filtermodels.cpp +++ b/qt-ui/filtermodels.cpp @@ -1,8 +1,5 @@ #include "filtermodels.h" -#include "dive.h" -#include "models.h" #include "mainwindow.h" -#include "display.h" #define CREATE_INSTANCE_METHOD( CLASS ) \ CLASS *CLASS::instance() \ diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index bbdf19722..c2bbeb415 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -1,14 +1,7 @@ #include "globe.h" #ifndef NO_MARBLE -#include "kmessagewidget.h" #include "mainwindow.h" -#include "ui_mainwindow.h" -#include "dive.h" -#include "divelist.h" #include "helpers.h" -#include "display.h" - -#include #include #include @@ -17,7 +10,7 @@ #include #include #include -#include + #ifdef MARBLE_SUBSURFACE_BRANCH #include #endif @@ -26,8 +19,6 @@ #else #include #endif -#include -#include // as of Marble 4.10 (which has MARBLE_VERSION 0x001000) zoomView is // deprecated and has been replaced by setZoom with the same function signature diff --git a/qt-ui/groupedlineedit.cpp b/qt-ui/groupedlineedit.cpp index be93f24d6..71abe72a0 100644 --- a/qt-ui/groupedlineedit.cpp +++ b/qt-ui/groupedlineedit.cpp @@ -28,19 +28,9 @@ #include "groupedlineedit.h" -#include -#include -#include #include -#include #include -#include -#include #include -#include -#include -#include -#include struct GroupedLineEdit::Private { struct Block { diff --git a/qt-ui/kmessagewidget.cpp b/qt-ui/kmessagewidget.cpp index 6059d707e..bfa8c2745 100644 --- a/qt-ui/kmessagewidget.cpp +++ b/qt-ui/kmessagewidget.cpp @@ -19,7 +19,6 @@ */ #include "kmessagewidget.h" -#include #include #include #include diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 629b36ad7..3c00a1bed 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -6,28 +6,16 @@ */ #include "maintab.h" #include "mainwindow.h" -#include "../helpers.h" -#include "../statistics.h" -#include "divelistview.h" +#include "helpers.h" +#include "statistics.h" #include "modeldelegates.h" -#include "globe.h" -#include "diveplanner.h" -#include "divelist.h" -#include "qthelper.h" -#include "display.h" -#include "divepicturewidget.h" #if defined(FBSUPPORT) #include "socialnetworks.h" #endif -#include #include -#include -#include #include -#include -#include #include #include #include diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 9186b7a0a..8835bb8e3 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -5,45 +5,20 @@ */ #include "mainwindow.h" -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include #include #include -#include -#include "divelistview.h" -#include "starwidget.h" #include "ssrf-version.h" -#include "dive.h" -#include "display.h" -#include "divelist.h" -#include "pref.h" -#include "helpers.h" -#include "modeldelegates.h" -#include "models.h" #include "downloadfromdivecomputer.h" #include "preferences.h" #include "subsurfacewebservices.h" #include "divecomputermanagementdialog.h" -#include "simplewidgets.h" -#include "diveplanner.h" #include "about.h" -#include "worldmap-save.h" #include "updatemanager.h" #include "planner.h" -#include "configuredivecomputerdialog.h" -#include "statistics/statisticswidget.h" #include "filtermodels.h" #ifndef NO_PRINTING #include diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index d2bdadc3b..cd195cc4f 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -1,26 +1,9 @@ #include "modeldelegates.h" #include "dive.h" -#include "divelist.h" -#include "starwidget.h" -#include "models.h" -#include "diveplanner.h" -#include "simplewidgets.h" #include "gettextfromc.h" -#include "profile/profilewidget2.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index a6fe549ba..334b2a1d2 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -1,7 +1,6 @@ #include "preferences.h" #include "mainwindow.h" #include -#include #include #include #include diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index df3b2f5b7..fbf71c453 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -3,16 +3,10 @@ #include "printlayout.h" #include "mainwindow.h" -#include -#include #include -#include -#include #include #include #include -#include -#include #include #if QT_VERSION >= 0x050300 diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 63819ad48..a347e1fdb 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -1,20 +1,11 @@ #include -#include -#include #include -#include -#include -#include -#include #include #include #include "mainwindow.h" -#include "../dive.h" -#include "../display.h" #include "printdialog.h" #include "printlayout.h" -#include "models.h" #include "modeldelegates.h" PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct print_options *optionsPtr) diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp index 21e299930..d3e148c69 100644 --- a/qt-ui/printoptions.cpp +++ b/qt-ui/printoptions.cpp @@ -1,5 +1,5 @@ #include "printoptions.h" -#include "../display.h" +#include "display.h" PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt) { diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp index fb1c85f8d..a19d50c9d 100644 --- a/qt-ui/profile/animationfunctions.cpp +++ b/qt-ui/profile/animationfunctions.cpp @@ -1,8 +1,6 @@ #include "animationfunctions.h" -#include "dive.h" #include "pref.h" #include -#include namespace Animations { diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index aaa85c634..467a8b978 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -1,17 +1,10 @@ #include "divecartesianaxis.h" -#include "divelineitem.h" #include "divetextitem.h" #include "helpers.h" #include "preferences.h" #include "diveplotdatamodel.h" #include "animationfunctions.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include static QPen gridPen() { diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index 1a5e29dda..2ec842179 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -3,10 +3,7 @@ #include "divecartesianaxis.h" #include "animationfunctions.h" #include "libdivecomputer.h" -#include "dive.h" -#include "planner.h" #include "profile.h" -#include #include "gettextfromc.h" #include "metrics.h" diff --git a/qt-ui/profile/divelineitem.cpp b/qt-ui/profile/divelineitem.cpp index 863cd6218..f9e288a44 100644 --- a/qt-ui/profile/divelineitem.cpp +++ b/qt-ui/profile/divelineitem.cpp @@ -1,6 +1,4 @@ #include "divelineitem.h" -#include "animationfunctions.h" -#include DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent) { diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp index 8aff5315d..c9129761e 100644 --- a/qt-ui/profile/divepixmapitem.cpp +++ b/qt-ui/profile/divepixmapitem.cpp @@ -3,12 +3,7 @@ #include #include -#include -#include -#include #include -#include -#include #include #include diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index e60dd9ddb..9c0edc079 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -1,10 +1,8 @@ #include "diveplotdatamodel.h" #include "dive.h" -#include "display.h" #include "profile.h" #include "graphicsview-common.h" #include "divelist.h" -#include DivePlotDataModel::DivePlotDataModel(QObject *parent) : QAbstractTableModel(parent), diveId(0) { diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 490f045fd..66faf982d 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -1,24 +1,15 @@ #include "diveprofileitem.h" #include "diveplotdatamodel.h" #include "divecartesianaxis.h" -#include "graphicsview-common.h" #include "divetextitem.h" -#include "profilewidget2.h" #include "animationfunctions.h" #include "dive.h" #include "profile.h" #include "preferences.h" #include "helpers.h" -#include "diveplanner.h" #include "libdivecomputer/parser.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include #include AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1) diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 761f0e6f7..85e046638 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -1,15 +1,6 @@ #include "divetextitem.h" -#include "animationfunctions.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include -#include - DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent), internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter), textBackgroundItem(new QGraphicsPathItem(this)), diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index e89feff9c..d4818422b 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -1,19 +1,13 @@ #include "divetooltipitem.h" #include "divecartesianaxis.h" -#include "profilewidget2.h" #include "dive.h" #include "profile.h" #include "membuffer.h" #include "metrics.h" #include -#include -#include -#include -#include #include #include #include -#include #define PORT_IN_PROGRESS 1 #ifdef PORT_IN_PROGRESS diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index b161032d4..516b14c2f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1,27 +1,16 @@ #include "profilewidget2.h" #include "diveplotdatamodel.h" -#include "divepixmapitem.h" -#include "diverectitem.h" -#include "divecartesianaxis.h" -#include "diveprofileitem.h" #include "helpers.h" #include "profile.h" #include "diveeventitem.h" #include "divetextitem.h" #include "divetooltipitem.h" -#include "animationfunctions.h" #include "planner.h" #include "device.h" #include "ruleritem.h" #include "tankitem.h" -#include "dive.h" #include "pref.h" #include -#include -#include -#include -#include -#include #include #include #include diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp index d38e88822..c88a3353d 100644 --- a/qt-ui/profile/ruleritem.cpp +++ b/qt-ui/profile/ruleritem.cpp @@ -1,21 +1,10 @@ #include "ruleritem.h" -#include "divetextitem.h" -#include "profilewidget2.h" #include "preferences.h" #include "mainwindow.h" -#include -#include -#include -#include -#include #include -#include - -#include #include "profile.h" -#include "display.h" RulerNodeItem2::RulerNodeItem2() : entry(NULL), ruler(NULL) { diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 59acb28e0..48b586dd5 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -2,8 +2,6 @@ #include "diveplotdatamodel.h" #include "divetextitem.h" #include "profile.h" -#include -#include #include TankItem::TankItem(QObject *parent) : diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 76400ef41..d258fe7af 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -1,31 +1,14 @@ #include "simplewidgets.h" #include "filtermodels.h" -#include #include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "exif.h" -#include "dive.h" + #include "file.h" -#include "display.h" #include "mainwindow.h" #include "helpers.h" -#include "ui_filterwidget.h" #include "libdivecomputer/parser.h" diff --git a/qt-ui/starwidget.cpp b/qt-ui/starwidget.cpp index 005396761..508d9a746 100644 --- a/qt-ui/starwidget.cpp +++ b/qt-ui/starwidget.cpp @@ -1,13 +1,7 @@ #include "starwidget.h" #include "metrics.h" #include -#include -#include -#include #include -#include -#include -#include #include "simplewidgets.h" QImage StarWidget::activeStar; diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index c98413d12..597fe03b6 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -2,25 +2,16 @@ #include "webservice.h" #include "mainwindow.h" #include "usersurvey.h" -#include -#include #include #include #include #include -#include -#include -#include #include #include #include #include -#include "dive.h" -#include "divelist.h" -#include "display.h" - #ifdef Q_OS_UNIX #include // for dup(2) #endif diff --git a/qt-ui/tableview.cpp b/qt-ui/tableview.cpp index a07a70dba..78a0bce10 100644 --- a/qt-ui/tableview.cpp +++ b/qt-ui/tableview.cpp @@ -3,11 +3,7 @@ #include "modeldelegates.h" #include -#include -#include -#include #include -#include TableView::TableView(QWidget *parent) : QGroupBox(parent) { diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index 54b488aa0..bfe535447 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -1,10 +1,6 @@ #include "tagwidget.h" -#include -#include -#include -#include -#include #include "mainwindow.h" +#include TagWidget::TagWidget(QWidget *parent) : GroupedLineEdit(parent), m_completer(NULL), lastFinishedTag(false) { diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp index d672b2dbb..865a54127 100644 --- a/qt-ui/updatemanager.cpp +++ b/qt-ui/updatemanager.cpp @@ -2,7 +2,6 @@ #include "usersurvey.h" #include #include -#include #include "subsurfacewebservices.h" #include "ssrf-version.h" #include "mainwindow.h" diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp index b6e6f09d6..ab6475155 100644 --- a/qt-ui/usermanual.cpp +++ b/qt-ui/usermanual.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include "usermanual.h" diff --git a/qt-ui/usersurvey.cpp b/qt-ui/usersurvey.cpp index a8916c990..1beb186ad 100644 --- a/qt-ui/usersurvey.cpp +++ b/qt-ui/usersurvey.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include "usersurvey.h" -- cgit v1.2.3-70-g09d2 From 9bdff95a35b4274bdf5e3bfcba119d494056457c Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sat, 17 Jan 2015 10:11:06 +0100 Subject: Use correct divemode (PSCR in particular) in deco calculation I had forgotten this dead code. Sorry. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- deco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deco.c b/deco.c index c2d54d59c..14f88f6f0 100644 --- a/deco.c +++ b/deco.c @@ -190,7 +190,7 @@ double add_segment(double pressure, const struct gasmix *gasmix, int period_in_s int ci; struct gas_pressures pressures; - fill_pressures(&pressures, pressure - WV_PRESSURE, gasmix, (double) ccpo2 / 1000.0, ccpo2 ? CCR : OC, sac); + fill_pressures(&pressures, pressure - WV_PRESSURE, gasmix, (double) ccpo2 / 1000.0, dive->dc.divemode, sac); if (buehlmann_config.gf_low_at_maxdepth && pressure > gf_low_pressure_this_dive) gf_low_pressure_this_dive = pressure; -- cgit v1.2.3-70-g09d2 From 76e3a10f08f20c447c0d93df9a1cc48cb9288c55 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Sat, 17 Jan 2015 19:54:10 +0100 Subject: Move the heart rate graph Move the heart rate graph down to the same space as the tissue saturation graph so that it does not overlap with temperature or partial pressures. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 60 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 516b14c2f..a390ae6a5 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -55,7 +55,7 @@ static struct _ItemPos { _Axis temperature; _Axis temperatureAll; _Axis heartBeat; - _Axis heartBeatAll; + _Axis heartBeatWithTankBar; } itemPos; ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), @@ -396,13 +396,11 @@ void ProfileWidget2::setupItemSizes() // Heartbeat axis config itemPos.heartBeat.pos.on.setX(3); - itemPos.heartBeat.pos.on.setY(65); + itemPos.heartBeat.pos.on.setY(82); itemPos.heartBeat.expanded.setP1(QPointF(0, 0)); itemPos.heartBeat.expanded.setP2(QPointF(0, 10)); - itemPos.heartBeatAll = itemPos.heartBeat; - itemPos.heartBeatAll.pos.on.setX(3); - itemPos.heartBeatAll.pos.on.setY(55); - itemPos.heartBeatAll.expanded.setP2(QPointF(0, 7)); + itemPos.heartBeatWithTankBar = itemPos.heartBeat; + itemPos.heartBeatWithTankBar.expanded.setP2(QPointF(0, 7)); // Percentage axis config itemPos.percentage.pos.on.setX(3); @@ -635,7 +633,7 @@ void ProfileWidget2::settingsChanged() // if we are showing calculated ceilings then we have to replot() // because the GF could have changed; otherwise we try to avoid replot() bool needReplot = prefs.calcceiling; - if (prefs.percentagegraph && PP_GRAPHS_ENABLED) { + if ((prefs.percentagegraph||prefs.hrgraph) && PP_GRAPHS_ENABLED) { profileYAxis->animateChangeLine(itemPos.depth.shrinked); temperatureAxis->setPos(itemPos.temperatureAll.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.shrinked); @@ -644,37 +642,36 @@ void ProfileWidget2::settingsChanged() if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); - } else { + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); + }else { percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); + percentageAxis->animateChangeLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } gasYAxis->setPos(itemPos.partialPressureTissue.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressureTissue.expanded); - if (prefs.hrgraph) { - heartBeatAxis->setPos(itemPos.heartBeatAll.pos.on); - heartBeatAxis->setLine(itemPos.heartBeatAll.expanded); - } + } else if (PP_GRAPHS_ENABLED || prefs.hrgraph || prefs.percentagegraph) { profileYAxis->animateChangeLine(itemPos.depth.intermediate); temperatureAxis->setPos(itemPos.temperature.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.intermediate); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.intermediate); - gasYAxis->setPos(itemPos.partialPressure.pos.on); - gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); - percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); - heartBeatAxis->setPos(itemPos.heartBeat.pos.on); - heartBeatAxis->setLine(itemPos.heartBeat.expanded); if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); gasYAxis->setPos(itemPos.partialPressureWithTankBar.pos.on); gasYAxis->setLine(itemPos.partialPressureWithTankBar.expanded); + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); } else { gasYAxis->setPos(itemPos.partialPressure.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); percentageAxis->setPos(itemPos.percentage.pos.on); percentageAxis->setLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } } else { profileYAxis->animateChangeLine(itemPos.depth.expanded); @@ -907,7 +904,7 @@ void ProfileWidget2::setProfileState() cylinderPressureAxis->setVisible(true); profileYAxis->setPos(itemPos.depth.pos.on); - if (prefs.percentagegraph && PP_GRAPHS_ENABLED) { + if ((prefs.percentagegraph||prefs.hrgraph) && PP_GRAPHS_ENABLED) { profileYAxis->animateChangeLine(itemPos.depth.shrinked); temperatureAxis->setPos(itemPos.temperatureAll.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.shrinked); @@ -916,37 +913,36 @@ void ProfileWidget2::setProfileState() if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); - } else { + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); + }else { percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); + percentageAxis->animateChangeLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } gasYAxis->setPos(itemPos.partialPressureTissue.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressureTissue.expanded); - if (prefs.hrgraph) { - heartBeatAxis->setPos(itemPos.heartBeatAll.pos.on); - heartBeatAxis->setLine(itemPos.heartBeatAll.expanded); - } + } else if (PP_GRAPHS_ENABLED || prefs.hrgraph || prefs.percentagegraph) { profileYAxis->animateChangeLine(itemPos.depth.intermediate); temperatureAxis->setPos(itemPos.temperature.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.intermediate); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.intermediate); - gasYAxis->setPos(itemPos.partialPressure.pos.on); - gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); - percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); - heartBeatAxis->setPos(itemPos.heartBeat.pos.on); - heartBeatAxis->setLine(itemPos.heartBeat.expanded); if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); gasYAxis->setPos(itemPos.partialPressureWithTankBar.pos.on); gasYAxis->setLine(itemPos.partialPressureWithTankBar.expanded); + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); } else { gasYAxis->setPos(itemPos.partialPressure.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); percentageAxis->setPos(itemPos.percentage.pos.on); percentageAxis->setLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } } else { profileYAxis->animateChangeLine(itemPos.depth.expanded); -- cgit v1.2.3-70-g09d2 From f5726ffa9d21f80232b1206456eaf971468c4b2f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 17 Jan 2015 07:02:03 -0800 Subject: Fix build: add missing #includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qt-ui/profile/profilewidget2.cpp:1351:10: error: invalid use of incomplete type ‘class QDebug’ qt-ui/printlayout.cpp:141:27: error: variable ‘QPointer profile’ has initializer but incomplete type In commit f9ceff009b35 ("Clean up the header files") things got broken for an as of now unreliesed future version of Qt. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- qt-ui/printlayout.cpp | 1 + qt-ui/profile/profilewidget2.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index a347e1fdb..6b88f0d29 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "mainwindow.h" #include "printdialog.h" diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index a390ae6a5..850f357cf 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #ifndef QT_NO_DEBUG #include -- cgit v1.2.3-70-g09d2 From 5a1be7620b4786d3522496e839bbdce5794f8ef9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 18 Jan 2015 14:34:00 -0200 Subject: Only update the "add dive profile / plan dive" 20x/s We were updating the dive quite a lot of times, we really didn't need to. This will help, but not fix, the issues with plan / add dive. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 6 ++++++ qt-ui/diveplanner.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 44ca6baf5..2ee168413 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -181,6 +181,7 @@ DiveHandler::DiveHandler() : QGraphicsEllipseItem() setFlags(ItemIgnoresTransformations | ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges); setBrush(Qt::white); setZValue(2); + t.start(); } int DiveHandler::parentIndex() @@ -225,9 +226,14 @@ void DiveHandler::changeGas() void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { + if (t.elapsed() < 40) + return; + t.start(); + ProfileWidget2 *view = qobject_cast(scene()->views().first()); if(view->isPointOutOfBoundaries(event->scenePos())) return; + QGraphicsEllipseItem::mouseMoveEvent(event); emit moved(); } diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index e6ae8e8b5..4093bacd1 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -133,6 +133,8 @@ public slots: void selfRemove(); void changeGas(); +private: + QTime t; }; #include "ui_diveplanner.h" -- cgit v1.2.3-70-g09d2 From ecf4d18b417aa9c50ddbc936dc65f80c58d64368 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 18 Jan 2015 19:17:24 -0200 Subject: Fix extreme sluggish profile over time Whoa, this deserves a good explanation. Everytime that the mouse moved in add / plan mode, or anytime a new dive was displayed on the profile, this method would be called and connect the dataModel to the modelChanged method. This added the slot in a call-vector that the fired signal would call, adding one call to the Slot per add / plan mouse move (about 20x/s) or each time a new dive was displayed. Quickly filling the vector with more than 200 - 300 calls to this same Slot. The fix is to only connect one time. this made the add / plan mode *so* much smoother... :) Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 48b586dd5..c0e75a371 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -50,7 +50,7 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str memcpy(pInfoEntry, plotInfo->entry, size); copy_cylinders(d, &diveCylinderStore, false); dataModel = model; - connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex))); + connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); modelDataChanged(); } -- cgit v1.2.3-70-g09d2 From 83018619d6f22efda3a98742598670d7bd76482b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 19 Jan 2015 17:17:01 +1200 Subject: Always updated the coordinates from the displayed_dive That's why it's called the displayed dive... Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 18 +++++++----------- qt-ui/maintab.h | 3 ++- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3c00a1bed..445ab2b5a 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -428,7 +428,7 @@ void MainTab::updateDiveInfo(bool clear) ui.DiveType->setCurrentIndex(displayed_dive.dc.divemode); if (!clear) { - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); // Subsurface always uses "local time" as in "whatever was the local time at the location" // so all time stamps have no time zone information and are in UTC QDateTime localTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset(displayed_dive.when)); @@ -750,7 +750,7 @@ void MainTab::acceptChanges() } struct dive *cd = current_dive; //Reset coordinates field, in case it contains garbage. - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); // now check if something has changed and if yes, edit the selected dives that // were identical with the master dive shown (and mark the divelist as changed) if (!same_string(displayed_dive.buddy, cd->buddy)) @@ -1137,7 +1137,7 @@ void MainTab::on_location_editingFinished() displayed_dive.latitude = dive->latitude; displayed_dive.longitude = dive->longitude; MainWindow::instance()->globe()->reload(); - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); break; } } @@ -1244,14 +1244,10 @@ void MainTab::updateCoordinatesText(qreal lat, qreal lon) ui.coordinates->setText(printGPSCoords(ulat, ulon)); } -void MainTab::updateGpsCoordinates(const struct dive *dive) +void MainTab::updateGpsCoordinates() { - if (dive) { - ui.coordinates->setText(printGPSCoords(dive->latitude.udeg, dive->longitude.udeg)); - ui.coordinates->setModified(dive->latitude.udeg || dive->longitude.udeg); - } else { - ui.coordinates->clear(); - } + ui.coordinates->setText(printGPSCoords(displayed_dive.latitude.udeg, displayed_dive.longitude.udeg)); + ui.coordinates->setModified(displayed_dive.latitude.udeg || displayed_dive.longitude.udeg); } void MainTab::escDetected() @@ -1300,7 +1296,7 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what) if (what.visibility) ui.visibility->setCurrentStars(displayed_dive.visibility); if (what.gps) - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); if (what.tags) { char buf[1024]; taglist_get_tagstring(displayed_dive.tag_list, buf, 1024); diff --git a/qt-ui/maintab.h b/qt-ui/maintab.h index 2f7277bbd..71703e3f1 100644 --- a/qt-ui/maintab.h +++ b/qt-ui/maintab.h @@ -92,6 +92,8 @@ slots: void escDetected(void); void photoDoubleClicked(const QString filePath); void removeSelectedPhotos(); + void updateGpsCoordinates(); + private: Ui::MainTab ui; WeightModel *weightModel; @@ -109,7 +111,6 @@ private: bool copyPaste; void resetPallete(); void saveTags(); - void updateGpsCoordinates(const struct dive *dive); void markChangedWidget(QWidget *w); dive_trip_t *currentTrip; dive_trip_t displayedTrip; -- cgit v1.2.3-70-g09d2 From df46b85ee1cc7a33fe35e69c19345a59c966fa41 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 19 Jan 2015 17:32:17 +1200 Subject: Don't just change the location when double clicking on the globe Instead be consistent with other parts of the code and put us in editing mode so the user can accept / reject the change. See #800 Fixes #801 Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 19 ++++++------------- qt-ui/globe.h | 3 +++ qt-ui/maintab.cpp | 3 +++ qt-ui/mainwindow.cpp | 2 ++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index c2bbeb415..d8beff91d 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -307,21 +307,14 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U lon = lon * 180 / M_PI; lat = lat * 180 / M_PI; } - - // right now we try to only ever do this with one dive selected, - // but we keep the code here that changes the coordinates for each selected dive - int i; - struct dive *dive; - for_each_dive (i, dive) { - if (!dive->selected) - continue; - dive->latitude.udeg = lrint(lat * 1000000.0); - dive->longitude.udeg = lrint(lon * 1000000.0); - } centerOn(lon, lat, true); + + // change the location of the displayed_dive and put the UI in edit mode + displayed_dive.latitude.udeg = lrint(lat * 1000000.0); + displayed_dive.longitude.udeg = lrint(lon * 1000000.0); + emit(coordinatesChanged()); + repopulateLabels(); editingDiveLocation = false; - mark_divelist_changed(true); - MainWindow::instance()->refreshDisplay(); } void GlobeGPS::mousePressEvent(QMouseEvent *event) diff --git a/qt-ui/globe.h b/qt-ui/globe.h index 8124a4d57..b6a33bbbe 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -39,6 +39,9 @@ private: bool editingDiveLocation; bool doubleClick; +signals: + void coordinatesChanged(void); + public slots: void changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit); diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 445ab2b5a..be55f6f29 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -1246,6 +1246,9 @@ void MainTab::updateCoordinatesText(qreal lat, qreal lon) void MainTab::updateGpsCoordinates() { + if (editMode == NONE) + enableEdition(); + ui.coordinates->setText(printGPSCoords(displayed_dive.latitude.udeg, displayed_dive.longitude.udeg)); ui.coordinates->setModified(displayed_dive.latitude.udeg || displayed_dive.longitude.udeg); } diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 8835bb8e3..5d5a442f4 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -96,6 +96,8 @@ MainWindow::MainWindow() : QMainWindow(), #ifdef NO_MARBLE ui.globePane->hide(); ui.menuView->removeAction(ui.actionViewGlobe); +#else + connect(ui.globe, SIGNAL(coordinatesChanged()), ui.InfoWidget, SLOT(updateGpsCoordinates())); #endif #ifdef NO_USERMANUAL ui.menuHelp->removeAction(ui.actionUserManual); -- cgit v1.2.3-70-g09d2 From 803d390044fe17597c914119a1e0b5411d8d92ff Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 19 Jan 2015 17:33:45 +1200 Subject: Show a flag when editing a location on the globe Since we don't modify the dive list, the new flag wouldn't show up until we accepted the change - that's not user friendly. Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index d8beff91d..2403758c4 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -187,9 +187,13 @@ void GlobeGPS::repopulateLabels() loadedDives = new GeoDataDocument; QMap locationMap; - int idx = 0; + int idx = -2; struct dive *dive; - for_each_dive (idx, dive) { + // normally we use for_each_dive (idx, dive) to loop over all dives, + // but we need to include the displayed_dive while things are + // edited, so let's hand roll this loop + while (++idx < dive_table.nr) { + dive = (idx == -1 ? &displayed_dive : get_dive(idx)); if (dive_has_gps_location(dive)) { GeoDataPlacemark *place = new GeoDataPlacemark(dive->location); place->setCoordinate(dive->longitude.udeg / 1000000.0, dive->latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree); -- cgit v1.2.3-70-g09d2 From f448bfd574bb9aa4593b43392131174dc489a4b0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 19 Jan 2015 17:37:31 +1200 Subject: Hide the old flag when editing a location on the map This ONLY hides the old flag if the current dive is the only dive on that location (which seems to make sense). Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 2403758c4..1e4639d5c 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -194,6 +194,10 @@ void GlobeGPS::repopulateLabels() // edited, so let's hand roll this loop while (++idx < dive_table.nr) { dive = (idx == -1 ? &displayed_dive : get_dive(idx)); + if (dive == current_dive) + // don't show that flag, it's either already shown as displayed_dive + // or it's the one that we are moving right now... + continue; if (dive_has_gps_location(dive)) { GeoDataPlacemark *place = new GeoDataPlacemark(dive->location); place->setCoordinate(dive->longitude.udeg / 1000000.0, dive->latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree); -- cgit v1.2.3-70-g09d2