Skip to content
Permalink
Browse files

Coverity uninitialized member fixes

  • Loading branch information
nyalldawson committed Aug 28, 2015
1 parent 253e131 commit ac6c32421ec8f36c4a6ccdff326dc7e9a6c37ef1
@@ -17,6 +17,8 @@ class QgsFieldConditionalFormatWidget : QWidget
*/
explicit QgsFieldConditionalFormatWidget( QWidget *parent /TransferThis/ = 0 );

~QgsFieldConditionalFormatWidget();

/** Switches the widget to the rules page.
*/
void viewRules();
@@ -1029,6 +1029,8 @@ QgisApp::~QgisApp()
delete mMapTools.mSplitParts;
delete mMapTools.mSvgAnnotation;
delete mMapTools.mTextAnnotation;
delete mMapTools.mCircularStringCurvePoint;
delete mMapTools.mCircularStringRadius;

delete mpMaptip;

@@ -1148,7 +1150,7 @@ void QgisApp::readSettings()
QStringList oldRecentProjects = settings.value( "/UI/recentProjectsList" ).toStringList();
settings.remove( "/UI/recentProjectsList" );

Q_FOREACH( const QString& project, oldRecentProjects )
Q_FOREACH ( const QString& project, oldRecentProjects )
{
QgsWelcomePageItemsModel::RecentProjectData data;
data.path = project;
@@ -1160,7 +1162,7 @@ void QgisApp::readSettings()
settings.beginGroup( "/UI/recentProjects" );
QStringList projectKeys = settings.childGroups();

Q_FOREACH( const QString& key, projectKeys )
Q_FOREACH ( const QString& key, projectKeys )
{
QgsWelcomePageItemsModel::RecentProjectData data;
settings.beginGroup( key );
@@ -2738,7 +2740,7 @@ void QgisApp::updateRecentProjectPaths()
{
mRecentProjectsMenu->clear();

Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
{
QAction* action = mRecentProjectsMenu->addAction( QString( "%1 (%2)" ).arg( recentProject.title ).arg( recentProject.path ) );
action->setEnabled( QFile::exists(( recentProject.path ) ) );
@@ -2807,7 +2809,7 @@ void QgisApp::saveRecentProjectPath( QString projectPath, bool savePreviewImage
int idx = 0;

// Persist the list
Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
{
++idx;
settings.beginGroup( QString( "/UI/recentProjects/%1" ).arg( idx ) );
@@ -1439,6 +1439,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
, mMeasureArea( 0 )
, mMeasureAngle( 0 )
, mAddFeature( 0 )
, mCircularStringCurvePoint( 0 )
, mCircularStringRadius( 0 )
, mMoveFeature( 0 )
, mOffsetCurve( 0 )
, mReshapeFeatures( 0 )
@@ -18,7 +18,10 @@

#include "qgsnetworkaccessmanager.h"

QgsVersionInfo::QgsVersionInfo( QObject *parent ) : QObject( parent )
QgsVersionInfo::QgsVersionInfo( QObject *parent )
: QObject( parent )
, mLatestVersion( 0 )
, mError( QNetworkReply::NoError )
{

}
@@ -3283,6 +3283,6 @@ bool QgsExpression::Node::prepare( QgsExpression* parent, const QgsExpressionCon
QVariant QgsExpression::StaticFunction::func( const QVariantList &values, const QgsFeature* f, QgsExpression* parent )
{
Q_NOWARN_DEPRECATED_PUSH
return mFnc( values, f, parent );
return mFnc ? mFnc( values, f, parent ) : QVariant();
Q_NOWARN_DEPRECATED_POP
}
@@ -437,6 +437,7 @@ class CORE_EXPORT QgsExpression
bool handlesNull = false )
: Function( fnname, params, group, helpText, usesGeometry, referencedColumns, lazyEval, handlesNull )
, mFnc( fcn )
, mContextFnc( 0 )
, mAliases( aliases )
{}

@@ -455,6 +456,7 @@ class CORE_EXPORT QgsExpression
const QStringList& aliases = QStringList(),
bool handlesNull = false )
: Function( fnname, params, group, helpText, usesGeometry, referencedColumns, lazyEval, handlesNull )
, mFnc( 0 )
, mContextFnc( fcn )
, mAliases( aliases )
{}
@@ -468,7 +470,7 @@ class CORE_EXPORT QgsExpression
*/
virtual QVariant func( const QVariantList& values, const QgsExpressionContext* context, QgsExpression* parent ) override
{
return mContextFnc( values, context, parent );
return mContextFnc ? mContextFnc( values, context, parent ) : QVariant();
}

virtual QStringList aliases() const override { return mAliases; }
@@ -6,9 +6,12 @@
#include "qgssymbollayerv2utils.h"
#include "qgsstylev2.h"

QgsFieldConditionalFormatWidget::QgsFieldConditionalFormatWidget( QWidget *parent ) :
QWidget( parent )
QgsFieldConditionalFormatWidget::QgsFieldConditionalFormatWidget( QWidget *parent )
: QWidget( parent )
, mLayer( 0 )
, mEditIndex( 0 )
, mEditing( false )
, mSymbol( 0 )
{
setupUi( this );
mDeleteButton->hide();
@@ -35,6 +38,11 @@ QgsFieldConditionalFormatWidget::QgsFieldConditionalFormatWidget( QWidget *paren
setPresets( defaultPresets() );
}

QgsFieldConditionalFormatWidget::~QgsFieldConditionalFormatWidget()
{
delete mSymbol;
}

void QgsFieldConditionalFormatWidget::updateIcon()
{
mSymbol = QgsSymbolV2::defaultSymbol( QGis::Point );
@@ -41,6 +41,8 @@ class GUI_EXPORT QgsFieldConditionalFormatWidget : public QWidget, private Ui::Q
*/
explicit QgsFieldConditionalFormatWidget( QWidget *parent = 0 );

~QgsFieldConditionalFormatWidget();

/** Switches the widget to the rules page.
*/
void viewRules();
@@ -39,6 +39,9 @@ class TestQgsComposerMap : public QObject
, mComposerMap( 0 )
, mMapSettings( 0 )
, mRasterLayer( 0 )
, mPointsLayer( 0 )
, mPolysLayer( 0 )
, mLinesLayer( 0 )
{}

private slots:

0 comments on commit ac6c324

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