Skip to content
Permalink
Browse files

Modernize code

  • Loading branch information
nyalldawson committed Sep 17, 2018
1 parent 144dd15 commit 4f2f9f74d4ae8273b4f817451e158917fa412534
@@ -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 );
@@ -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();
@@ -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 );
@@ -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();
@@ -156,7 +142,7 @@ eVisGenericEventBrowserGui::eVisGenericEventBrowserGui( QWidget *parent, QgsMapC


/**
* Basic descructor
* Basic destructor
*/
eVisGenericEventBrowserGui::~eVisGenericEventBrowserGui()
{
@@ -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;
@@ -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;
@@ -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;

0 comments on commit 4f2f9f7

Please sign in to comment.
You can’t perform that action at this time.