Skip to content
Permalink
Browse files

Fix Coverity uninitialized member warnings

  • Loading branch information
nyalldawson committed Jun 5, 2016
1 parent 813a21d commit fab16ecbec4c765fecb5ae97ca23a1a7ad70b70e
@@ -544,6 +544,7 @@ QgisApp *QgisApp::smInstance = nullptr;
// constructor starts here
QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCheck, QWidget * parent, Qt::WindowFlags fl )
: QMainWindow( parent, fl )
, mProfiler( nullptr )
, mNonEditMapTool( nullptr )
, mScaleWidget( nullptr )
, mMagnifierWidget( nullptr )
@@ -587,13 +588,13 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
}

smInstance = this;
profiler = QgsRuntimeProfiler::instance();
mProfiler = QgsRuntimeProfiler::instance();

namSetup();

// load GUI: actions, menus, toolbars
profiler->beginGroup( "qgisapp" );
profiler->beginGroup( "startup" );
mProfiler->beginGroup( "qgisapp" );
mProfiler->beginGroup( "startup" );
startProfile( "Setting up UI" );
setupUi( this );
endProfile();
@@ -1054,14 +1055,14 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
#ifdef ANDROID
toggleFullScreen();
#endif
profiler->endGroup();
profiler->endGroup();
mProfiler->endGroup();
mProfiler->endGroup();

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

QgisApp::QgisApp()
: QMainWindow( nullptr, nullptr )
, mProfiler( nullptr )
, mStyleSheetBuilder( nullptr )
, mActionPluginSeparator1( nullptr )
, mActionPluginSeparator2( nullptr )
@@ -11041,12 +11043,12 @@ void QgisApp::keyPressEvent( QKeyEvent * e )

void QgisApp::startProfile( const QString& name )
{
profiler->start( name );
mProfiler->start( name );
}

void QgisApp::endProfile()
{
profiler->end();
mProfiler->end();
}

void QgisApp::functionProfile( void ( QgisApp::*fnc )(), QgisApp* instance, QString name )
@@ -1379,7 +1379,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void endProfile();
void functionProfile( void ( QgisApp::*fnc )(), QgisApp *instance, QString name );

QgsRuntimeProfiler* profiler;
QgsRuntimeProfiler* mProfiler;

/** This method will open a dialog so the user can select GDAL sublayers to load
* @returns true if any items were loaded
@@ -35,6 +35,7 @@ QgsArrowSymbolLayer::QgsArrowSymbolLayer()
, mScaledHeadHeight( 1.5 )
, mScaledOffset( 0.0 )
, mComputedHeadType( HeadSingle )
, mComputedArrowType( ArrowPlain )
{
/* default values */
setOffset( 0.0 );
@@ -34,6 +34,7 @@
QgsAfsProvider::QgsAfsProvider( const QString& uri )
: QgsVectorDataProvider( uri )
, mValid( false )
, mObjectIdFieldIdx( -1 )
{
mDataSource = QgsDataSourceURI( uri );

@@ -482,9 +482,17 @@ QVariantMap QgsArcGisRestUtils::queryServiceJSON( const QUrl &url, QString &erro

QgsArcGisAsyncQuery::QgsArcGisAsyncQuery( QObject* parent )
: QObject( parent )
, mReply( nullptr )
, mResult( nullptr )
{
}

QgsArcGisAsyncQuery::~QgsArcGisAsyncQuery()
{
if ( mReply )
mReply->deleteLater();
}

void QgsArcGisAsyncQuery::start( const QUrl &url, QByteArray *result, bool allowCache )
{
mResult = result;
@@ -522,14 +530,16 @@ void QgsArcGisAsyncQuery::handleReply()
}

*mResult = mReply->readAll();
mResult = 0;
mResult = nullptr;
emit finished();
}

///////////////////////////////////////////////////////////////////////////////

QgsArcGisAsyncParallelQuery::QgsArcGisAsyncParallelQuery( QObject* parent )
: QObject( parent )
, mResults( nullptr )
, mPendingRequests( 0 )
{
}

@@ -585,7 +595,7 @@ void QgsArcGisAsyncParallelQuery::handleReply()
if ( mPendingRequests == 0 )
{
emit finished( mErrors );
mResults = 0;
mResults = nullptr;
mErrors.clear();
}
}
@@ -48,7 +48,9 @@ class QgsArcGisAsyncQuery : public QObject
{
Q_OBJECT
public:
QgsArcGisAsyncQuery( QObject* parent = 0 );
QgsArcGisAsyncQuery( QObject* parent = nullptr );
~QgsArcGisAsyncQuery();

void start( const QUrl& url, QByteArray* result, bool allowCache = false );
signals:
void finished();
@@ -65,7 +67,7 @@ class QgsArcGisAsyncParallelQuery : public QObject
{
Q_OBJECT
public:
QgsArcGisAsyncParallelQuery( QObject* parent = 0 );
QgsArcGisAsyncParallelQuery( QObject* parent = nullptr );
void start( const QVector<QUrl>& urls, QVector<QByteArray>* results, bool allowCache = false );
signals:
void finished( QStringList errors );

0 comments on commit fab16ec

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