Skip to content

Commit fab16ec

Browse files
committedJun 5, 2016
Fix Coverity uninitialized member warnings
1 parent 813a21d commit fab16ec

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ QgisApp *QgisApp::smInstance = nullptr;
544544
// constructor starts here
545545
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCheck, QWidget * parent, Qt::WindowFlags fl )
546546
: QMainWindow( parent, fl )
547+
, mProfiler( nullptr )
547548
, mNonEditMapTool( nullptr )
548549
, mScaleWidget( nullptr )
549550
, mMagnifierWidget( nullptr )
@@ -587,13 +588,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
587588
}
588589

589590
smInstance = this;
590-
profiler = QgsRuntimeProfiler::instance();
591+
mProfiler = QgsRuntimeProfiler::instance();
591592

592593
namSetup();
593594

594595
// load GUI: actions, menus, toolbars
595-
profiler->beginGroup( "qgisapp" );
596-
profiler->beginGroup( "startup" );
596+
mProfiler->beginGroup( "qgisapp" );
597+
mProfiler->beginGroup( "startup" );
597598
startProfile( "Setting up UI" );
598599
setupUi( this );
599600
endProfile();
@@ -1054,14 +1055,14 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
10541055
#ifdef ANDROID
10551056
toggleFullScreen();
10561057
#endif
1057-
profiler->endGroup();
1058-
profiler->endGroup();
1058+
mProfiler->endGroup();
1059+
mProfiler->endGroup();
10591060

10601061
QgsDebugMsg( "PROFILE TIMES" );
1061-
QgsDebugMsg( QString( "PROFILE TIMES TOTAL - %1 " ).arg( profiler->totalTime() ) );
1062+
QgsDebugMsg( QString( "PROFILE TIMES TOTAL - %1 " ).arg( mProfiler->totalTime() ) );
10621063
#ifdef QGISDEBUG
1063-
QList<QPair<QString, double> >::const_iterator it = profiler->profileTimes().constBegin();
1064-
for ( ; it != profiler->profileTimes().constEnd(); ++it )
1064+
QList<QPair<QString, double> >::const_iterator it = mProfiler->profileTimes().constBegin();
1065+
for ( ; it != mProfiler->profileTimes().constEnd(); ++it )
10651066
{
10661067
QString name = ( *it ).first;
10671068
double time = ( *it ).second;
@@ -1073,6 +1074,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
10731074

10741075
QgisApp::QgisApp()
10751076
: QMainWindow( nullptr, nullptr )
1077+
, mProfiler( nullptr )
10761078
, mStyleSheetBuilder( nullptr )
10771079
, mActionPluginSeparator1( nullptr )
10781080
, mActionPluginSeparator2( nullptr )
@@ -11041,12 +11043,12 @@ void QgisApp::keyPressEvent( QKeyEvent * e )
1104111043

1104211044
void QgisApp::startProfile( const QString& name )
1104311045
{
11044-
profiler->start( name );
11046+
mProfiler->start( name );
1104511047
}
1104611048

1104711049
void QgisApp::endProfile()
1104811050
{
11049-
profiler->end();
11051+
mProfiler->end();
1105011052
}
1105111053

1105211054
void QgisApp::functionProfile( void ( QgisApp::*fnc )(), QgisApp* instance, QString name )

‎src/app/qgisapp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
13791379
void endProfile();
13801380
void functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, QString name );
13811381

1382-
QgsRuntimeProfiler* profiler;
1382+
QgsRuntimeProfiler* mProfiler;
13831383

13841384
/** This method will open a dialog so the user can select GDAL sublayers to load
13851385
* @returns true if any items were loaded

‎src/core/symbology-ng/qgsarrowsymbollayer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ QgsArrowSymbolLayer::QgsArrowSymbolLayer()
3535
, mScaledHeadHeight( 1.5 )
3636
, mScaledOffset( 0.0 )
3737
, mComputedHeadType( HeadSingle )
38+
, mComputedArrowType( ArrowPlain )
3839
{
3940
/* default values */
4041
setOffset( 0.0 );

‎src/providers/arcgisrest/qgsafsprovider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
QgsAfsProvider::QgsAfsProvider( const QString& uri )
3535
: QgsVectorDataProvider( uri )
3636
, mValid( false )
37+
, mObjectIdFieldIdx( -1 )
3738
{
3839
mDataSource = QgsDataSourceURI( uri );
3940

‎src/providers/arcgisrest/qgsarcgisrestutils.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,17 @@ QVariantMap QgsArcGisRestUtils::queryServiceJSON( const QUrl &url, QString &erro
482482

483483
QgsArcGisAsyncQuery::QgsArcGisAsyncQuery( QObject* parent )
484484
: QObject( parent )
485+
, mReply( nullptr )
486+
, mResult( nullptr )
485487
{
486488
}
487489

490+
QgsArcGisAsyncQuery::~QgsArcGisAsyncQuery()
491+
{
492+
if ( mReply )
493+
mReply->deleteLater();
494+
}
495+
488496
void QgsArcGisAsyncQuery::start( const QUrl &url, QByteArray *result, bool allowCache )
489497
{
490498
mResult = result;
@@ -522,14 +530,16 @@ void QgsArcGisAsyncQuery::handleReply()
522530
}
523531

524532
*mResult = mReply->readAll();
525-
mResult = 0;
533+
mResult = nullptr;
526534
emit finished();
527535
}
528536

529537
///////////////////////////////////////////////////////////////////////////////
530538

531539
QgsArcGisAsyncParallelQuery::QgsArcGisAsyncParallelQuery( QObject* parent )
532540
: QObject( parent )
541+
, mResults( nullptr )
542+
, mPendingRequests( 0 )
533543
{
534544
}
535545

@@ -585,7 +595,7 @@ void QgsArcGisAsyncParallelQuery::handleReply()
585595
if ( mPendingRequests == 0 )
586596
{
587597
emit finished( mErrors );
588-
mResults = 0;
598+
mResults = nullptr;
589599
mErrors.clear();
590600
}
591601
}

‎src/providers/arcgisrest/qgsarcgisrestutils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class QgsArcGisAsyncQuery : public QObject
4848
{
4949
Q_OBJECT
5050
public:
51-
QgsArcGisAsyncQuery( QObject* parent = 0 );
51+
QgsArcGisAsyncQuery( QObject* parent = nullptr );
52+
~QgsArcGisAsyncQuery();
53+
5254
void start( const QUrl& url, QByteArray* result, bool allowCache = false );
5355
signals:
5456
void finished();
@@ -65,7 +67,7 @@ class QgsArcGisAsyncParallelQuery : public QObject
6567
{
6668
Q_OBJECT
6769
public:
68-
QgsArcGisAsyncParallelQuery( QObject* parent = 0 );
70+
QgsArcGisAsyncParallelQuery( QObject* parent = nullptr );
6971
void start( const QVector<QUrl>& urls, QVector<QByteArray>* results, bool allowCache = false );
7072
signals:
7173
void finished( QStringList errors );

0 commit comments

Comments
 (0)
Please sign in to comment.