Skip to content
Permalink
Browse files

Add missing overrides, fix warnings

  • Loading branch information
nyalldawson committed Sep 28, 2015
1 parent 216821f commit 927a0db0b43ea57996ece30031c805c1b6fbe9fe
@@ -55,7 +55,7 @@ class QgsSettingsTree : public QTreeWidget
QgsSettingsTree( QWidget *parent = 0 );

void setSettingsObject( QSettings *settings );
QSize sizeHint() const;
QSize sizeHint() const override;

void setSettingsMap( QMap< QString, QStringList > & map ) { settingsMap = map; }
QString itemKey( QTreeWidgetItem *item );
@@ -67,7 +67,7 @@ class QgsSettingsTree : public QTreeWidget
void refresh();

protected:
bool event( QEvent *event );
bool event( QEvent *event ) override;

private slots:
void updateSetting( QTreeWidgetItem *item );
@@ -52,12 +52,12 @@ class QgsVariantDelegate : public QItemDelegate
QgsVariantDelegate( QObject* parent = 0 );

void paint( QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index ) const;
const QModelIndex& index ) const override;
QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option,
const QModelIndex &index ) const;
void setEditorData( QWidget* editor, const QModelIndex& index ) const;
const QModelIndex &index ) const override;
void setEditorData( QWidget* editor, const QModelIndex& index ) const override;
void setModelData( QWidget* editor, QAbstractItemModel* model,
const QModelIndex &index ) const;
const QModelIndex &index ) const override;

static bool isSupportedType( QVariant::Type type );
static QString displayText( const QVariant& value );
@@ -552,7 +552,9 @@ bool QgsAuthManager::resetMasterPassword( const QString& newpass, const QString
emit messageOut( tr( err ), authManTag(), WARNING );
}
if ( ok )
{
QgsDebugMsg( "Master password reset: cleared current password from database" );
}

// mMasterPass empty, set new password (don't verify, since not stored yet)
setMasterPassword( newpass, false );
@@ -566,7 +568,9 @@ bool QgsAuthManager::resetMasterPassword( const QString& newpass, const QString
emit messageOut( tr( err ), authManTag(), WARNING );
}
if ( ok )
{
QgsDebugMsg( "Master password reset: stored new password in database" );
}

// verify it stored password properly
if ( ok && !verifyMasterPassword() )
@@ -586,7 +590,9 @@ bool QgsAuthManager::resetMasterPassword( const QString& newpass, const QString
emit messageOut( tr( err ), authManTag(), WARNING );
}
if ( ok )
{
QgsDebugMsg( "Master password reset: re-encrypted configs in database" );
}

// verify it all worked
if ( ok && !verifyPasswordCanDecryptConfigs() )
@@ -1296,7 +1302,7 @@ bool QgsAuthManager::updateNetworkRequest( QNetworkRequest &request, const QStri
QgsAuthMethod* authmethod = configAuthMethod( authcfg );
if ( authmethod )
{
if ( !authmethod->supportedExpansions() & QgsAuthMethod::NetworkRequest )
if ( !( authmethod->supportedExpansions() & QgsAuthMethod::NetworkRequest ) )
{
QgsDebugMsg( QString( "Data source URI updating not supported by authcfg: %1" ).arg( authcfg ) );
return false;
@@ -1322,7 +1328,7 @@ bool QgsAuthManager::updateNetworkReply( QNetworkReply *reply, const QString& au
QgsAuthMethod* authmethod = configAuthMethod( authcfg );
if ( authmethod )
{
if ( !authmethod->supportedExpansions() & QgsAuthMethod::NetworkReply )
if ( !( authmethod->supportedExpansions() & QgsAuthMethod::NetworkReply ) )
{
QgsDebugMsg( QString( "Network reply updating not supported by authcfg: %1" ).arg( authcfg ) );
return false;
@@ -1348,7 +1354,7 @@ bool QgsAuthManager::updateDataSourceUriItems( QStringList &connectionItems, con
QgsAuthMethod* authmethod = configAuthMethod( authcfg );
if ( authmethod )
{
if ( !authmethod->supportedExpansions() & QgsAuthMethod::DataSourceURI )
if ( !( authmethod->supportedExpansions() & QgsAuthMethod::DataSourceURI ) )
{
QgsDebugMsg( QString( "Data source URI updating not supported by authcfg: %1" ).arg( authcfg ) );
return false;
@@ -21,14 +21,14 @@ class QgsGeometryContainedCheckError : public QgsGeometryCheckError
: QgsGeometryCheckError( check, featureId, errorLocation, QgsVertexId(), otherId, ValueOther ), mOtherId( otherId ) { }
const QgsFeatureId& otherId() const { return mOtherId; }

bool isEqual( QgsGeometryCheckError* other ) const
bool isEqual( QgsGeometryCheckError* other ) const override
{
return other->check() == check() &&
other->featureId() == featureId() &&
static_cast<QgsGeometryContainedCheckError*>( other )->otherId() == otherId();
}
}

virtual QString description() const { return QApplication::translate( "QgsGeometryContainedCheckError", "Within %1" ).arg( otherId() ); }
virtual QString description() const override { return QApplication::translate( "QgsGeometryContainedCheckError", "Within %1" ).arg( otherId() ); }

private:
QgsFeatureId mOtherId;
@@ -20,13 +20,13 @@ class QgsGeometryDuplicateCheckError : public QgsGeometryCheckError
: QgsGeometryCheckError( check, featureId, errorLocation, QgsVertexId(), duplicatesString( duplicates ) ), mDuplicates( duplicates ) { }
const QList<QgsFeatureId>& duplicates() const { return mDuplicates; }

bool isEqual( QgsGeometryCheckError* other ) const
bool isEqual( QgsGeometryCheckError* other ) const override
{
return other->check() == check() &&
other->featureId() == featureId() &&
// static_cast: since other->checker() == checker is only true if the types are actually the same
static_cast<QgsGeometryDuplicateCheckError*>( other )->duplicates() == duplicates();
}
}

private:
QList<QgsFeatureId> mDuplicates;
@@ -30,22 +30,22 @@ class QgsGeometryGapCheckError : public QgsGeometryCheckError
delete mGeometry;
}

QgsAbstractGeometryV2* geometry() { return mGeometry->clone(); }
QgsAbstractGeometryV2* geometry() override { return mGeometry->clone(); }
const QgsFeatureIds& neighbors() const { return mNeighbors; }

bool isEqual( QgsGeometryCheckError* other ) const
bool isEqual( QgsGeometryCheckError* other ) const override
{
QgsGeometryGapCheckError* err = dynamic_cast<QgsGeometryGapCheckError*>( other );
return err && QgsGeomUtils::pointsFuzzyEqual( err->location(), location(), QgsGeometryCheckPrecision::reducedTolerance() ) && err->neighbors() == neighbors();
}
}

bool closeMatch( QgsGeometryCheckError *other ) const
bool closeMatch( QgsGeometryCheckError *other ) const override
{
QgsGeometryGapCheckError* err = dynamic_cast<QgsGeometryGapCheckError*>( other );
return err && err->neighbors() == neighbors();
}
}

void update( const QgsGeometryCheckError* other )
void update( const QgsGeometryCheckError* other ) override
{
QgsGeometryCheckError::update( other );
// Static cast since this should only get called if isEqual == true
@@ -56,12 +56,12 @@ class QgsGeometryGapCheckError : public QgsGeometryCheckError
mGapAreaBBox = err->mGapAreaBBox;
}

bool handleChanges( const QgsGeometryCheck::Changes& /*changes*/ )
bool handleChanges( const QgsGeometryCheck::Changes& /*changes*/ ) override
{
return true;
}

QgsRectangle affectedAreaBBox() const
QgsRectangle affectedAreaBBox() override
{
return mGapAreaBBox;
}
@@ -21,23 +21,23 @@ class QgsGeometryOverlapCheckError : public QgsGeometryCheckError
: QgsGeometryCheckError( check, featureId, errorLocation, QgsVertexId(), value, ValueArea ), mOtherId( otherId ) { }
const QgsFeatureId& otherId() const { return mOtherId; }

bool isEqual( QgsGeometryCheckError* other ) const
bool isEqual( QgsGeometryCheckError* other ) const override
{
QgsGeometryOverlapCheckError* err = dynamic_cast<QgsGeometryOverlapCheckError*>( other );
return err &&
other->featureId() == featureId() &&
err->otherId() == otherId() &&
QgsGeomUtils::pointsFuzzyEqual( location(), other->location(), QgsGeometryCheckPrecision::reducedTolerance() ) &&
qAbs( value().toDouble() - other->value().toDouble() ) < QgsGeometryCheckPrecision::reducedTolerance();
}
}

bool closeMatch( QgsGeometryCheckError *other ) const
bool closeMatch( QgsGeometryCheckError *other ) const override
{
QgsGeometryOverlapCheckError* err = dynamic_cast<QgsGeometryOverlapCheckError*>( other );
return err && other->featureId() == featureId() && err->otherId() == otherId();
}
}

virtual QString description() const { return QApplication::translate( "QgsGeometryTypeCheckError", "Overlap with %1" ).arg( otherId() ); }
virtual QString description() const override { return QApplication::translate( "QgsGeometryTypeCheckError", "Overlap with %1" ).arg( otherId() ); }

private:
QgsFeatureId mOtherId;
@@ -21,8 +21,8 @@ class QgsGeometrySelfIntersectionCheckError : public QgsGeometryCheckError
const QgsGeometryUtils::SelfIntersection& inter )
: QgsGeometryCheckError( check, featureId, errorLocation, vidx ), mInter( inter ) { }
const QgsGeometryUtils::SelfIntersection& intersection() const { return mInter; }
bool isEqual( QgsGeometryCheckError* other ) const;
bool handleChanges( const QgsGeometryCheck::Changes& changes );
bool isEqual( QgsGeometryCheckError* other ) const override;
bool handleChanges( const QgsGeometryCheck::Changes& changes ) override;
void update( const QgsGeometrySelfIntersectionCheckError* other )
{
QgsGeometryCheckError::update( other );
@@ -22,13 +22,13 @@ class QgsGeometryTypeCheckError : public QgsGeometryCheckError
mTypeName = QgsWKBTypes::displayString( flatType );
}

bool isEqual( QgsGeometryCheckError* other ) const
bool isEqual( QgsGeometryCheckError* other ) const override
{
return QgsGeometryCheckError::isEqual( other ) &&
mTypeName == static_cast<QgsGeometryTypeCheckError*>( other )->mTypeName;
}
}

virtual QString description() const { return QString( "%1 (%2)" ).arg( mCheck->errorDescription(), mTypeName ); }
virtual QString description() const override { return QString( "%1 (%2)" ).arg( mCheck->errorDescription(), mTypeName ); }

private:
QString mTypeName;
@@ -29,8 +29,8 @@ class QgsGeometryCheckerPlugin : public QObject, public QgisPlugin
{
public:
QgsGeometryCheckerPlugin( QgisInterface* iface );
void initGui();
void unload();
void initGui() override;
void unload() override;

private:
QgisInterface* mIface;
@@ -30,9 +30,9 @@ class QgsGeometryCheckFactory
template<class T>
class QgsGeometryCheckFactoryT : public QgsGeometryCheckFactory
{
void restorePrevious( Ui::QgsGeometryCheckerSetupTab& /*ui*/ ) const;
bool checkApplicability( Ui::QgsGeometryCheckerSetupTab& ui, QGis::GeometryType geomType ) const;
QgsGeometryCheck* createInstance( QgsFeaturePool* featurePool, const Ui::QgsGeometryCheckerSetupTab& ui, double mapToLayerUnits ) const;
void restorePrevious( Ui::QgsGeometryCheckerSetupTab& /*ui*/ ) const override;
bool checkApplicability( Ui::QgsGeometryCheckerSetupTab& ui, QGis::GeometryType geomType ) const override;
QgsGeometryCheck* createInstance( QgsFeaturePool* featurePool, const Ui::QgsGeometryCheckerSetupTab& ui, double mapToLayerUnits ) const override;
};

class QgsGeometryCheckFactoryRegistry
@@ -37,8 +37,8 @@ class QgsGeometryCheckerDialog : public QDialog
QDialogButtonBox* mButtonBox;
QTabWidget* mTabWidget;

void done( int r );
void closeEvent( QCloseEvent *ev );
void done( int r ) override;
void closeEvent( QCloseEvent *ev ) override;

private slots:
void onCheckerStarted( QgsGeometryChecker* checker, QgsFeaturePool* featurePool );
@@ -50,7 +50,7 @@ class QgsGeometryCheckerFixDialog : public QDialog
QPushButton* mFixBtn;
QPushButton* mSkipBtn;

void showEvent( QShowEvent * );
void showEvent( QShowEvent * ) override;

private slots:
void setupNextError();
@@ -35,8 +35,8 @@ class QgsGeometrySnapperPlugin : public QObject, public QgisPlugin
{
public:
QgsGeometrySnapperPlugin( QgisInterface* iface );
void initGui();
void unload();
void initGui() override;
void unload() override;

private:
QgisInterface* mIface;
@@ -51,15 +51,15 @@ class QgsSnapIndex
{
public:
PointSnapItem( const CoordIdx* _idx );
QgsPointV2 getSnapPoint( const QgsPointV2 &/*p*/ ) const;
QgsPointV2 getSnapPoint( const QgsPointV2 &/*p*/ ) const override;
const CoordIdx* idx;
};

class SegmentSnapItem : public QgsSnapIndex::SnapItem
{
public:
SegmentSnapItem( const CoordIdx* _idxFrom, const CoordIdx* _idxTo );
QgsPointV2 getSnapPoint( const QgsPointV2 &p ) const;
QgsPointV2 getSnapPoint( const QgsPointV2 &p ) const override;
bool getIntersection( const QgsPointV2& p1, const QgsPointV2& p2, QgsPointV2& inter ) const;
bool getProjection( const QgsPointV2 &p, QgsPointV2 &pProj );
const CoordIdx* idxFrom;

0 comments on commit 927a0db

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