Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modernize code
  • Loading branch information
nyalldawson committed Sep 17, 2018
1 parent 144dd15 commit 4f2f9f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
20 changes: 3 additions & 17 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
Expand Up @@ -53,6 +53,7 @@
*/
eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgisInterface *interface, Qt::WindowFlags fl )
: QDialog( parent, fl )
, mInterface( interface )
{
setupUi( this );
connect( buttonboxOptions, &QDialogButtonBox::clicked, this, &eVisGenericEventBrowserGui::buttonboxOptions_clicked );
Expand Down Expand Up @@ -82,14 +83,6 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgisInt
QSettings settings;
restoreGeometry( settings.value( QStringLiteral( "eVis/browser-geometry" ) ).toByteArray() );

mCurrentFeatureIndex = 0;
mInterface = interface;
mDataProvider = nullptr;
mVectorLayer = nullptr;
mCanvas = nullptr;

mIgnoreEvent = false;

if ( initBrowser() )
{
loadRecord();
Expand All @@ -109,6 +102,7 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgisInt
*/
eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgsMapCanvas *canvas, Qt::WindowFlags fl )
: QDialog( parent, fl )
, mCanvas( canvas )
{
setupUi( this );
connect( buttonboxOptions, &QDialogButtonBox::clicked, this, &eVisGenericEventBrowserGui::buttonboxOptions_clicked );
Expand All @@ -135,14 +129,6 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgsMapC
connect( rbtnManualCompassOffset, &QRadioButton::toggled, this, &eVisGenericEventBrowserGui::rbtnManualCompassOffset_toggled );
connect( tableFileTypeAssociations, &QTableWidget::cellDoubleClicked, this, &eVisGenericEventBrowserGui::tableFileTypeAssociations_cellDoubleClicked );

mCurrentFeatureIndex = 0;
mInterface = nullptr;
mDataProvider = nullptr;
mVectorLayer = nullptr;
mCanvas = canvas;

mIgnoreEvent = false;

if ( initBrowser() )
{
loadRecord();
Expand All @@ -156,7 +142,7 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgsMapC


/**
* Basic descructor
* Basic destructor
*/
eVisGenericEventBrowserGui::~eVisGenericEventBrowserGui()
{
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.h
Expand Up @@ -68,22 +68,22 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB
private:
//Variables
//! \brief A flag to bypass some signal/slots during gui initialization
bool mIgnoreEvent;
bool mIgnoreEvent = false;

//! \brief Pointer to the main configurations object
eVisConfiguration mConfiguration;

//! \brief Flag indicating if the browser fully initialized
bool mBrowserInitialized;
bool mBrowserInitialized = false;

//! \brief Index of the attribute field name that closest 'matches' configuration of the parameter
int mDefaultCompassBearingField;
int mDefaultCompassBearingField = 0;

//! \brief Index of the attribute field name that closest 'matches' configuration of the parameter
int mDefaultCompassOffsetField;
int mDefaultCompassOffsetField = 0;

//! \brief Index of the attribute field name that closest 'matches' configuration of the parameter
int mDefaultEventImagePathField;
int mDefaultEventImagePathField = 0;

//! \brief Pointer to the QgisInferface
QgisInterface *mInterface = nullptr;
Expand All @@ -104,10 +104,10 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB
QPixmap mPointerSymbol;

//! \brief Compass bearing value for the current feature
double mCompassBearing;
double mCompassBearing = 0;

//! \brief Compass bearing offset retrieved from attribute
double mCompassOffset;
double mCompassOffset = 0;

//! \brief QString holding the path to the image for the current feature
QString mEventImagePath;
Expand All @@ -116,7 +116,7 @@ class eVisGenericEventBrowserGui : public QDialog, private Ui::eVisGenericEventB
QList<QgsFeatureId> mFeatureIds;

//! \brief Index of selected feature being viewed, used to access mFeatureIds
int mCurrentFeatureIndex;
int mCurrentFeatureIndex = 0;

//! \brief Current feature being viewed
QgsFeature mFeature;
Expand Down

0 comments on commit 4f2f9f7

Please sign in to comment.