diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-02-06 13:25:58 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-06 13:29:31 -0800 |
commit | 17134be96d42fe36ac882b59cd50cf5105ae1399 (patch) | |
tree | 9c1315614aaa47292cf42c5ca2923d3af9a3bdb3 /profile-widget/profilewidget2.h | |
parent | d2928a137cabab30973a96a71beee9fd840db516 (diff) | |
download | subsurface-17134be96d42fe36ac882b59cd50cf5105ae1399.tar.gz |
Profile: don't compile code that isn't needed on mobile
We were creating a couple dozen objects that we never needed and because
of that triggered several dozen callbacks whenever the model data changed.
All for UI elements of the profile that are either not used in the mobile
app (like the calculated ceiling or the partial pressure / tissue
saturation graphs), or are only useful when using the profile
interactively (which we also don't do on mobile).
I don't know if this will make a significant impact on performance, but it
seems like the right thing to do either way.
A positive side effect is that the odd blue line on top of the rendered
profile is gone as well.
Fixes #1007
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r-- | profile-widget/profilewidget2.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index ad593a8d7..438523340 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -72,7 +72,6 @@ public: ProfileWidget2(QWidget *parent = 0); void resetZoom(); void plotDive(struct dive *d = 0, bool force = false); - virtual bool eventFilter(QObject *, QEvent *); void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, DivePlotDataModel *model, int vData, int hData, int zValue); void setPrintMode(bool mode, bool grayscale = false); bool getPrintMode(); @@ -82,6 +81,7 @@ public: double getFontPrintScale(); void setFontPrintScale(double scale); #ifndef SUBSURFACE_MOBILE + virtual bool eventFilter(QObject *, QEvent *); void clearHandlers(); #endif void recalcCeiling(); @@ -106,12 +106,12 @@ slots: // Necessary to call from QAction's signals. void actionRequestedReplot(bool triggered); void setEmptyState(); void setProfileState(); - void setPlanState(); - void setAddState(); void plotPictures(); void setReplot(bool state); void replot(dive *d = 0); #ifndef SUBSURFACE_MOBILE + void setPlanState(); + void setAddState(); void changeGas(); void addSetpointChange(); void addBookmark(); @@ -142,14 +142,14 @@ slots: // Necessary to call from QAction's signals. protected: virtual ~ProfileWidget2(); virtual void resizeEvent(QResizeEvent *event); +#ifndef SUBSURFACE_MOBILE virtual void wheelEvent(QWheelEvent *event); virtual void mouseMoveEvent(QMouseEvent *event); -#ifndef SUBSURFACE_MOBILE virtual void contextMenuEvent(QContextMenuEvent *event); -#endif virtual void mouseDoubleClickEvent(QMouseEvent *event); virtual void mousePressEvent(QMouseEvent *event); virtual void mouseReleaseEvent(QMouseEvent *event); +#endif void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; @@ -171,7 +171,9 @@ private: qreal zoomFactor; DivePixmapItem *background; QString backgroundFile; +#ifndef SUBSURFACE_MOBILE ToolTipItem *toolTipItem; +#endif bool isPlotZoomed; bool replotEnabled; // All those here should probably be merged into one structure, @@ -189,10 +191,11 @@ private: DiveGasPressureItem *gasPressureItem; QList<DiveEventItem *> eventItems; DiveTextItem *diveComputerText; + DiveReportedCeiling *reportedCeiling; +#ifndef SUBSURFACE_MOBILE DiveCalculatedCeiling *diveCeiling; DiveTextItem *decoModelParameters; QList<DiveCalculatedTissue *> allTissues; - DiveReportedCeiling *reportedCeiling; PartialPressureGasItem *pn2GasItem; PartialPressureGasItem *pheGasItem; PartialPressureGasItem *po2GasItem; @@ -209,6 +212,7 @@ private: DiveLineItem *mouseFollowerVertical; DiveLineItem *mouseFollowerHorizontal; RulerItem2 *rulerItem; +#endif TankItem *tankItem; bool isGrayscale; bool printMode; |