diff --git a/src/app/gps/qgsgpsinformationwidget.cpp b/src/app/gps/qgsgpsinformationwidget.cpp
index 9669151740cf..b003bc8fabc1 100644
--- a/src/app/gps/qgsgpsinformationwidget.cpp
+++ b/src/app/gps/qgsgpsinformationwidget.cpp
@@ -584,9 +584,7 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
QColor bg( Qt::white ); // moved several items outside of the following if block to minimize loop time
bg.setAlpha( 200 );
QColor myColor;
- QBrush symbolBrush( Qt::black );
- QBrush textBgBrush( bg );
- QSize markerSize( 9, 9 );
+
// Add a marker to the polar plot
if ( currentInfo.id > 0 ) // don't show satellite if id=0 (no satellite indication)
{
@@ -607,6 +605,9 @@ void QgsGPSInformationWidget::displayGPSInformation( const QgsGPSInformation& in
myColor = Qt::black; //strong signal
}
#ifdef WITH_QWTPOLAR
+ QBrush symbolBrush( Qt::black );
+ QSize markerSize( 9, 9 );
+ QBrush textBgBrush( bg );
#if (QWT_POLAR_VERSION<0x010000)
mypMarker->setSymbol( QwtSymbol( QwtSymbol::Ellipse,
symbolBrush, QPen( myColor ), markerSize ) );
diff --git a/src/app/main.cpp b/src/app/main.cpp
index b40b59c4d0b0..fbadca4c56cc 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -936,7 +936,7 @@ int main( int argc, char *argv[] )
QString i18nPath = QgsApplication::i18nPath();
QString myUserLocale = mySettings.value( "locale/userLocale", "" ).toString();
bool myLocaleOverrideFlag = mySettings.value( "locale/overrideFlag", false ).toBool();
- QString myLocale;
+
//
// Priority of translation is:
// - command line
diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp
index d25ad76c80a0..f7daa192efc2 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -10477,8 +10477,6 @@ void QgisApp::refreshActionFeatureAction()
// this is a slot for action from GUI to add raster layer
void QgisApp::addRasterLayer()
{
- QString fileFilters;
-
QStringList selectedFiles;
QString e;//only for parameter correctness
QString title = tr( "Open a GDAL Supported Raster Data Source" );
@@ -10856,6 +10854,7 @@ void QgisApp::showBookmarks()
void QgisApp::oldProjectVersionWarning( const QString& oldVersion )
{
+ Q_UNUSED( oldVersion );
QSettings settings;
if ( settings.value( "/qgis/warnOldProjectVersion", QVariant( true ) ).toBool() )
@@ -10864,24 +10863,6 @@ void QgisApp::oldProjectVersionWarning( const QString& oldVersion )
" When saving this project file, QGIS will update it to the latest version, "
"possibly rendering it useless for older versions of QGIS." );
- QString text = tr( "
This project file was saved by an older version of QGIS."
- " When saving this project file, QGIS will update it to the latest version, "
- "possibly rendering it useless for older versions of QGIS."
- "
Even though QGIS developers try to maintain backwards "
- "compatibility, some of the information from the old project "
- "file might be lost."
- " To improve the quality of QGIS, we appreciate "
- "if you file a bug report at %3."
- " Be sure to include the old project file, and state the version of "
- "QGIS you used to discover the error."
- "
To remove this warning when opening an older project file, "
- "uncheck the box '%5' in the %4 menu."
- "
Version of the project file: %1
Current version of QGIS: %2" )
- .arg( oldVersion,
- QGis::QGIS_VERSION,
- "https://hub.qgis.org/projects/quantum-gis ",
- tr( "Settings:Options:General", "Menu path to setting options" ),
- tr( "Warn me when opening a project file saved with an older version of QGIS" ) );
QString title = tr( "Project file is older" );
#ifdef ANDROID
@@ -11225,8 +11206,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList &errors
timer->stop();
}
- QString requesturl = reply->request().url().toString();
- QgsDebugMsg( QString( "SSL errors occurred accessing URL:\n%1" ).arg( requesturl ) );
+ QgsDebugMsg( QString( "SSL errors occurred accessing URL:\n%1" ).arg( reply->request().url().toString() ) );
QString hostport( QString( "%1:%2" )
.arg( reply->url().host() )
diff --git a/src/app/qgsbrowserdockwidget.cpp b/src/app/qgsbrowserdockwidget.cpp
index ef31b0691640..11346f80ab39 100644
--- a/src/app/qgsbrowserdockwidget.cpp
+++ b/src/app/qgsbrowserdockwidget.cpp
@@ -122,7 +122,6 @@ void QgsBrowserLayerProperties::setItem( QgsDataItem* item )
QgsMapLayer::LayerType type = layerItem->mapLayerType();
QString layerMetadata = tr( "Error" );
QgsCoordinateReferenceSystem layerCrs;
- QString notice;
// temporarily override /Projections/defaultBehaviour to avoid dialog prompt
QSettings settings;
diff --git a/src/app/qgshandlebadlayers.cpp b/src/app/qgshandlebadlayers.cpp
index 6c6450d3c1cf..d8c0482eebe1 100644
--- a/src/app/qgshandlebadlayers.cpp
+++ b/src/app/qgshandlebadlayers.cpp
@@ -368,8 +368,6 @@ void QgsHandleBadLayers::apply()
int idx = mLayerList->item( i, 0 )->data( Qt::UserRole ).toInt();
QDomNode &node = const_cast( mLayers[ idx ] );
- QString type = mLayerList->item( i, 1 )->text();
- QString provider = mLayerList->item( i, 2 )->text();
QTableWidgetItem *item = mLayerList->item( i, 4 );
QString datasource = item->text();
diff --git a/src/app/qgslabeldialog.cpp b/src/app/qgslabeldialog.cpp
index 612f842704b6..31a724a56ebc 100644
--- a/src/app/qgslabeldialog.cpp
+++ b/src/app/qgslabeldialog.cpp
@@ -279,6 +279,7 @@ void QgsLabelDialog::changeFont()
qreal fontSize = mFont.pointSizeF();
bool resultFlag;
QFont newFont = QgisGui::getFont( resultFlag, mFont );
+ Q_UNUSED( newFont );
if ( !resultFlag )
return;
diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp
index 5c3ac712d785..4d403be6f965 100644
--- a/src/app/qgsoptions.cpp
+++ b/src/app/qgsoptions.cpp
@@ -634,7 +634,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
initContrastEnhancement( cboxContrastEnhancementAlgorithmMultiBandSingleByte, "multiBandSingleByte", "NoEnhancement" );
initContrastEnhancement( cboxContrastEnhancementAlgorithmMultiBandMultiByte, "multiBandMultiByte", "StretchToMinimumMaximum" );
- QString cumulativeCutText = tr( "Cumulative pixel count cut" );
cboxContrastEnhancementLimits->addItem( tr( "Cumulative pixel count cut" ), "CumulativeCut" );
cboxContrastEnhancementLimits->addItem( tr( "Minimum / maximum" ), "MinMax" );
cboxContrastEnhancementLimits->addItem( tr( "Mean +/- standard deviation" ), "StdDev" );
@@ -807,7 +806,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
//set elements in digitizing tab
mLineWidthSpinBox->setValue( mSettings->value( "/qgis/digitizing/line_width", 1 ).toInt() );
- QColor digitizingColor;
myRed = mSettings->value( "/qgis/digitizing/line_color_red", 255 ).toInt();
myGreen = mSettings->value( "/qgis/digitizing/line_color_green", 0 ).toInt();
myBlue = mSettings->value( "/qgis/digitizing/line_color_blue", 0 ).toInt();
diff --git a/src/app/qgsvectorlayerproperties.cpp b/src/app/qgsvectorlayerproperties.cpp
index 836035a49874..d505f416aa17 100644
--- a/src/app/qgsvectorlayerproperties.cpp
+++ b/src/app/qgsvectorlayerproperties.cpp
@@ -901,7 +901,6 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", QDir::homePath() ).toString();
- QString format, extension;
if ( styleType == DB )
{
QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( mLayer->providerType() );
diff --git a/src/core/composer/qgscomposerlabel.cpp b/src/core/composer/qgscomposerlabel.cpp
index 3b92ab836471..53c4df18eef1 100644
--- a/src/core/composer/qgscomposerlabel.cpp
+++ b/src/core/composer/qgscomposerlabel.cpp
@@ -395,8 +395,6 @@ QFont QgsComposerLabel::font() const
bool QgsComposerLabel::writeXML( QDomElement& elem, QDomDocument & doc ) const
{
- QString alignment;
-
if ( elem.isNull() )
{
return false;
@@ -429,8 +427,6 @@ bool QgsComposerLabel::writeXML( QDomElement& elem, QDomDocument & doc ) const
bool QgsComposerLabel::readXML( const QDomElement& itemElem, const QDomDocument& doc )
{
- QString alignment;
-
if ( itemElem.isNull() )
{
return false;
diff --git a/src/core/composer/qgslegendmodel.cpp b/src/core/composer/qgslegendmodel.cpp
index af653ecc7ce2..5f4044d30949 100644
--- a/src/core/composer/qgslegendmodel.cpp
+++ b/src/core/composer/qgslegendmodel.cpp
@@ -784,7 +784,6 @@ bool QgsLegendModel::removeRows( int row, int count, const QModelIndex & parent
QMimeData* QgsLegendModel::mimeData( const QModelIndexList &indexes ) const
{
QMimeData* mimeData = new QMimeData();
- QByteArray encodedData;
QDomDocument xmlDoc;
QDomElement xmlRootElement = xmlDoc.createElement( "LegendModelDragData" );
xmlDoc.appendChild( xmlRootElement );
diff --git a/src/core/qgsdataitem.cpp b/src/core/qgsdataitem.cpp
index ed556ed6b365..ab04dad3d0b1 100644
--- a/src/core/qgsdataitem.cpp
+++ b/src/core/qgsdataitem.cpp
@@ -1442,7 +1442,6 @@ QgsDataItem* QgsZipItem::itemFromPath( QgsDataItem* parent, const QString& fileP
QString scanZipSetting = settings.value( "/qgis/scanZipInBrowser2", "basic" ).toString();
int zipFileCount = 0;
QStringList zipFileList;
- QFileInfo fileInfo( filePath );
QString vsiPrefix = QgsZipItem::vsiPrefix( filePath );
QgsZipItem * zipItem = nullptr;
bool populated = false;
diff --git a/src/core/qgsdiagramrendererv2.cpp b/src/core/qgsdiagramrendererv2.cpp
index 2a627b49c7db..80c900cef6b5 100644
--- a/src/core/qgsdiagramrendererv2.cpp
+++ b/src/core/qgsdiagramrendererv2.cpp
@@ -371,7 +371,6 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc,
categoryElem.setAttribute( "minimumSize", QString::number( minimumSize ) );
categoryElem.setAttribute( "angleOffset", QString::number( angleOffset ) );
- QString colors;
int nCats = qMin( categoryColors.size(), categoryAttributes.size() );
for ( int i = 0; i < nCats; ++i )
{
diff --git a/src/core/qgserror.cpp b/src/core/qgserror.cpp
index 67f9525a0c74..4178019ef315 100644
--- a/src/core/qgserror.cpp
+++ b/src/core/qgserror.cpp
@@ -51,7 +51,10 @@ QString QgsError::message( QgsErrorMessage::Format theFormat ) const
{
QString str;
+#ifdef QGISDEBUG
QString srcUrl;
+#endif
+
#if defined(QGISDEBUG) && defined(QGS_GIT_REMOTE_URL)
// TODO: verify if we are not ahead to origin (remote hash does not exist)
// and there are no local not commited changes
diff --git a/src/core/qgsfontutils.cpp b/src/core/qgsfontutils.cpp
index b3d173b934de..9d4c30b4ccec 100644
--- a/src/core/qgsfontutils.cpp
+++ b/src/core/qgsfontutils.cpp
@@ -239,12 +239,11 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles )
{
continue;
}
- QString familyStyle = QString( "%1 %2" ).arg( fontFamily, fontstyle );
if ( fontFamilyHasStyle( fontFamily, fontstyle ) )
{
fontsLoaded = ( fontsLoaded || false );
- QgsDebugMsg( QString( "Test font '%1' already available" ).arg( familyStyle ) );
+ QgsDebugMsg( QString( "Test font '%1 %2' already available" ).arg( fontFamily, fontstyle ) );
}
else
{
@@ -259,8 +258,8 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles )
int fontID = QFontDatabase::addApplicationFont( fontPath );
loaded = ( fontID != -1 );
fontsLoaded = ( fontsLoaded || loaded );
- QgsDebugMsg( QString( "Test font '%1' %2 from filesystem [%3]" )
- .arg( familyStyle, loaded ? "loaded" : "FAILED to load", fontPath ) );
+ QgsDebugMsg( QString( "Test font '%1 %2' %3 from filesystem [%4]" )
+ .arg( fontFamily, fontstyle, loaded ? "loaded" : "FAILED to load", fontPath ) );
QFontDatabase db;
QgsDebugMsg( QString( "font families in %1: %2" ).arg( fontID ).arg( db.applicationFontFamilies( fontID ).join( "," ) ) );
}
@@ -273,8 +272,8 @@ bool QgsFontUtils::loadStandardTestFonts( const QStringList& loadstyles )
loaded = ( fontID != -1 );
fontsLoaded = ( fontsLoaded || loaded );
}
- QgsDebugMsg( QString( "Test font '%1' %2 from testdata.qrc" )
- .arg( familyStyle, loaded ? "loaded" : "FAILED to load" ) );
+ QgsDebugMsg( QString( "Test font '%1' %3 from testdata.qrc" )
+ .arg( fontFamily, fontstyle, loaded ? "loaded" : "FAILED to load" ) );
}
}
}
diff --git a/src/core/qgsmaprenderercustompainterjob.cpp b/src/core/qgsmaprenderercustompainterjob.cpp
index f842a4deda3d..a729346cda51 100644
--- a/src/core/qgsmaprenderercustompainterjob.cpp
+++ b/src/core/qgsmaprenderercustompainterjob.cpp
@@ -71,10 +71,11 @@ void QgsMapRendererCustomPainterJob::start()
mPainter->setRenderHint( QPainter::Antialiasing, mSettings.testFlag( QgsMapSettings::Antialiasing ) );
+#ifndef QT_NO_DEBUG
QPaintDevice* thePaintDevice = mPainter->device();
-
QString errMsg = QString( "pre-set DPI not equal to painter's DPI (%1 vs %2)" ).arg( thePaintDevice->logicalDpiX() ).arg( mSettings.outputDpi() );
Q_ASSERT_X( thePaintDevice->logicalDpiX() == mSettings.outputDpi(), "Job::startRender()", errMsg.toAscii().data() );
+#endif
delete mLabelingEngine;
mLabelingEngine = nullptr;
diff --git a/src/core/qgsogcutils.cpp b/src/core/qgsogcutils.cpp
index c5f8046f0526..ce92b7712449 100644
--- a/src/core/qgsogcutils.cpp
+++ b/src/core/qgsogcutils.cpp
@@ -914,12 +914,6 @@ QgsRectangle QgsOgcUtils::rectangleFromGMLBox( const QDomNode& boxNode )
bool QgsOgcUtils::readGMLPositions( QgsPolyline &coords, const QDomElement &elem )
{
- //tupel and coord separator are the same
- QString coordSeparator = " ";
- QString tupelSeparator = " ";
- //"decimal" has to be "."
-
-
coords.clear();
QStringList pos = elem.text().split( ' ', QString::SkipEmptyParts );
diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp
index 62ca7f8920eb..a7bb09f37bbb 100644
--- a/src/core/qgspallabeling.cpp
+++ b/src/core/qgspallabeling.cpp
@@ -3015,7 +3015,9 @@ bool QgsPalLayerSettings::dataDefinedValEval( DataDefinedValueType valType,
{
if ( dataDefinedEvaluate( p, exprVal, &context, originalValue ) )
{
- QString dbgStr = QString( "exprVal %1:" ).arg( mDataDefinedNames.value( p ).first ) + "%1";
+#ifdef QGISDEBUG
+ QString dbgStr = QString( "exprVal %1:" ).arg( mDataDefinedNames.value( p ).first ) + "%1"; // clazy:exclude=unused-non-trivial-variable
+#endif
switch ( valType )
{
diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp
index 1829dd3d58a8..689c7a8b4af8 100644
--- a/src/core/qgsproject.cpp
+++ b/src/core/qgsproject.cpp
@@ -1134,7 +1134,6 @@ bool QgsProject::write()
if ( ml )
{
- QString externalProjectFile = layerIsEmbedded( ml->id() );
QHash< QString, QPair< QString, bool> >::const_iterator emIt = mEmbeddedLayers.constFind( ml->id() );
if ( emIt == mEmbeddedLayers.constEnd() )
{
diff --git a/src/core/qgsvectorlayer.cpp b/src/core/qgsvectorlayer.cpp
index 7dce07ddbca5..5eda21993303 100644
--- a/src/core/qgsvectorlayer.cpp
+++ b/src/core/qgsvectorlayer.cpp
@@ -882,9 +882,7 @@ QgsRectangle QgsVectorLayer::extent()
QgsRectangle mbr = mDataProvider->extent();
// show the extent
- QString s = mbr.toString();
-
- QgsDebugMsg( "Extent of layer: " + s );
+ QgsDebugMsg( "Extent of layer: " + mbr.toString() );
// store the extent
setExtent( mbr );
diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp
index c34c192251fe..4e0c58ae7e5e 100644
--- a/src/core/raster/qgsrasterlayer.cpp
+++ b/src/core/raster/qgsrasterlayer.cpp
@@ -679,8 +679,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
QgsRectangle mbr = mDataProvider->extent();
// show the extent
- QString s = mbr.toString();
- QgsDebugMsgLevel( "Extent of layer: " + s, 4 );
+ QgsDebugMsgLevel( "Extent of layer: " + mbr.toString(), 4 );
// store the extent
setExtent( mbr );
@@ -693,15 +692,11 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
// Setup source CRS
setCrs( QgsCoordinateReferenceSystem( mDataProvider->crs() ) );
- QString mySourceWkt = crs().toWkt();
-
- QgsDebugMsgLevel( "using wkt:\n" + mySourceWkt, 4 );
+ QgsDebugMsgLevel( "using wkt:\n" + crs().toWkt(), 4 );
//defaults - Needs to be set after the Contrast list has been build
//Try to read the default contrast enhancement from the config file
- QSettings myQSettings;
-
//decide what type of layer this is...
//TODO Change this to look at the color interp and palette interp to decide which type of layer it is
QgsDebugMsgLevel( "bandCount = " + QString::number( mDataProvider->bandCount() ), 4 );
diff --git a/src/core/symbology-ng/qgscptcityarchive.cpp b/src/core/symbology-ng/qgscptcityarchive.cpp
index c11772dc8ccf..db23d8a07d55 100644
--- a/src/core/symbology-ng/qgscptcityarchive.cpp
+++ b/src/core/symbology-ng/qgscptcityarchive.cpp
@@ -967,7 +967,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
if ( ! mRampsMap.isEmpty() )
return mRampsMap;
- QString curName, prevName, prevPath, curVariant, curSep, schemeName;
+ QString curName, prevName, curVariant, curSep, schemeName;
QStringList listVariant;
QStringList schemeNamesAll, schemeNames;
bool prevAdd, curAdd;
diff --git a/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp b/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
index 1d4d089325e1..0571ff1565d0 100644
--- a/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
+++ b/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
@@ -208,7 +208,6 @@ QgsSingleSymbolRendererV2* QgsSingleSymbolRendererV2::clone() const
void QgsSingleSymbolRendererV2::toSld( QDomDocument& doc, QDomElement &element ) const
{
QgsStringMap props;
- QString errorMsg;
if ( mRotation.data() )
props[ "angle" ] = mRotation->expression();
if ( mSizeScale.data() )
diff --git a/src/core/symbology-ng/qgsstylev2.cpp b/src/core/symbology-ng/qgsstylev2.cpp
index e51cef1ca08c..0ea619266ed3 100644
--- a/src/core/symbology-ng/qgsstylev2.cpp
+++ b/src/core/symbology-ng/qgsstylev2.cpp
@@ -1311,7 +1311,6 @@ QgsSmartConditionMap QgsStyleV2::smartgroup( int id )
}
QDomElement smartEl = doc.documentElement();
- QString op = smartEl.attribute( "operator" );
QDomNodeList conditionNodes = smartEl.childNodes();
for ( int i = 0; i < conditionNodes.count(); i++ )
diff --git a/src/core/symbology-ng/qgssvgcache.cpp b/src/core/symbology-ng/qgssvgcache.cpp
index 56fb4effcf1a..dea5eb944d8b 100644
--- a/src/core/symbology-ng/qgssvgcache.cpp
+++ b/src/core/symbology-ng/qgssvgcache.cpp
@@ -756,7 +756,6 @@ void QgsSvgCache::containsElemParams( const QDomElement& elem, bool& hasFillPara
{
continue;
}
- QString key = keyValueSplit.at( 0 );
QString value = keyValueSplit.at( 1 );
valueSplit = value.split( ' ' );
if ( !hasFillParam && value.startsWith( "param(fill)" ) )
diff --git a/src/gui/qgsbrowsertreeview.cpp b/src/gui/qgsbrowsertreeview.cpp
index 08547c735e87..62b398a1c4c2 100644
--- a/src/gui/qgsbrowsertreeview.cpp
+++ b/src/gui/qgsbrowsertreeview.cpp
@@ -107,8 +107,7 @@ void QgsBrowserTreeView::expandTree( const QModelIndex & index )
if ( !model() )
return;
- QString itemPath = model()->data( index, QgsBrowserModel::PathRole ).toString();
- QgsDebugMsg( "itemPath = " + itemPath );
+ QgsDebugMsg( "itemPath = " + model()->data( index, QgsBrowserModel::PathRole ).toString() );
expand( index );
QModelIndex parentIndex = model()->parent( index );
diff --git a/src/gui/qgscomposerruler.cpp b/src/gui/qgscomposerruler.cpp
index 04225bf5b828..ae3199f313af 100644
--- a/src/gui/qgscomposerruler.cpp
+++ b/src/gui/qgscomposerruler.cpp
@@ -361,8 +361,10 @@ int QgsComposerRuler::optimumNumberDivisions( double rulerScale, int scaleMultip
void QgsComposerRuler::setSceneTransform( const QTransform& transform )
{
+#if 0
QString debug = QString::number( transform.dx() ) + ',' + QString::number( transform.dy() ) + ','
+ QString::number( transform.m11() ) + ',' + QString::number( transform.m22() );
+#endif
mTransform = transform;
update();
}
diff --git a/src/gui/qgsmapcanvas.cpp b/src/gui/qgsmapcanvas.cpp
index b2fc0a7e88ad..c7d4211fd892 100644
--- a/src/gui/qgsmapcanvas.cpp
+++ b/src/gui/qgsmapcanvas.cpp
@@ -1180,10 +1180,6 @@ void QgsMapCanvas::keyPressEvent( QKeyEvent * e )
return;
}
- QPainter paint;
- QPen pen( Qt::gray );
- QgsPoint ll, ur;
-
if ( ! mCanvasProperties->mouseButtonDown )
{
// Don't want to interfer with mouse events
diff --git a/src/gui/raster/qgsrasterhistogramwidget.cpp b/src/gui/raster/qgsrasterhistogramwidget.cpp
index 19c4672b1095..79cf2df41298 100644
--- a/src/gui/raster/qgsrasterhistogramwidget.cpp
+++ b/src/gui/raster/qgsrasterhistogramwidget.cpp
@@ -688,7 +688,7 @@ void QgsRasterHistogramWidget::on_mSaveAsImageButton_clicked()
QPair< QString, QString> myFileNameAndFilter = QgisGui::getSaveAsImageName( this, tr( "Choose a file name to save the map image as" ) );
QFileInfo myInfo( myFileNameAndFilter.first );
- if ( QFileInfo( myFileNameAndFilter.first ).baseName() != "" )
+ if ( myInfo.baseName() != "" )
{
histoSaveAsImage( myFileNameAndFilter.first );
}
diff --git a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
index d3d3e0a1ad53..86fd4187bed8 100644
--- a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
+++ b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
@@ -1096,8 +1096,7 @@ void QgsStyleV2ManagerDialog::removeGroup()
void QgsStyleV2ManagerDialog::groupRenamed( QStandardItem * item )
{
- QString data = item->data( Qt::UserRole + 1 ).toString();
- QgsDebugMsg( "Symbol group edited: data=" + data + " text=" + item->text() );
+ QgsDebugMsg( "Symbol group edited: data=" + item->data( Qt::UserRole + 1 ).toString() + " text=" + item->text() );
int id = item->data( Qt::UserRole + 1 ).toInt();
QString name = item->text();
if ( item->parent()->data( Qt::UserRole + 1 ) == "smartgroups" )
diff --git a/src/gui/symbology-ng/qgssymbolslistwidget.cpp b/src/gui/symbology-ng/qgssymbolslistwidget.cpp
index 46f20ea20def..338fb3094916 100644
--- a/src/gui/symbology-ng/qgssymbolslistwidget.cpp
+++ b/src/gui/symbology-ng/qgssymbolslistwidget.cpp
@@ -182,8 +182,6 @@ void QgsSymbolsListWidget::populateSymbolView()
void QgsSymbolsListWidget::populateSymbols( const QStringList& names )
{
QSize previewSize = viewSymbols->iconSize();
- QPixmap p( previewSize );
- QPainter painter;
QStandardItemModel* model = qobject_cast( viewSymbols->model() );
if ( !model )
diff --git a/src/helpviewer/main.cpp b/src/helpviewer/main.cpp
index 9f6528b43903..5d0d9413baa6 100644
--- a/src/helpviewer/main.cpp
+++ b/src/helpviewer/main.cpp
@@ -35,7 +35,6 @@ int main( int argc, char ** argv )
QCoreApplication::setOrganizationDomain( "qgis.org" );
QCoreApplication::setApplicationName( "QGIS2" );
- QString context = QString::null;
QString myTranslationCode = "";
if ( argc == 2 )
diff --git a/src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp b/src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
index 73a53ead28ce..720e21177682 100644
--- a/src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
+++ b/src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
@@ -197,8 +197,9 @@ void eVisImageDisplayWidget::displayImage()
*/
void eVisImageDisplayWidget::displayUrlImage( const QString& url )
{
- QUrl myUrl( url );
+ Q_UNUSED( url );
#if QT_VERSION < 0x050000
+ QUrl myUrl( url );
mHttpConnection->setHost( myUrl.host() );
mCurrentHttpImageRequestId = mHttpConnection->get( myUrl.path().replace( '\\', '/' ), mHttpBuffer );
#endif
diff --git a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
index 569164caa939..6563527f5804 100644
--- a/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
+++ b/src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
@@ -157,7 +157,6 @@ void QgsOracleSelectGeoraster::connectToServer()
QSettings settings;
QString key = "/Oracle/connections/" + cmbConnections->currentText();
QString username = settings.value( key + "/username" ).toString();
- QString password = settings.value( key + "/password" ).toString();
QString savepass = settings.value( key + "/savepass" ).toString();
QString database = settings.value( key + "/database" ).toString();
QString subdtset = settings.value( key + "/subdtset" ).toString();
@@ -165,12 +164,12 @@ void QgsOracleSelectGeoraster::connectToServer()
if ( savepass == "false" )
{
makeConnection = false;
- QString password = QInputDialog::getText( this,
- tr( "Password for %1/@%2" ).arg( username, database ),
- tr( "Please enter your password:" ),
- QLineEdit::Password,
- QString::null,
- &makeConnection );
+ ( void )QInputDialog::getText( this,
+ tr( "Password for %1/@%2" ).arg( username, database ),
+ tr( "Please enter your password:" ),
+ QLineEdit::Password,
+ QString::null,
+ &makeConnection );
}
if ( makeConnection )
{
diff --git a/src/plugins/roadgraph/roadgraphplugin.cpp b/src/plugins/roadgraph/roadgraphplugin.cpp
index 248e2a4af658..e656bdbb0d79 100644
--- a/src/plugins/roadgraph/roadgraphplugin.cpp
+++ b/src/plugins/roadgraph/roadgraphplugin.cpp
@@ -199,7 +199,6 @@ QgisInterface* RoadGraphPlugin::iface()
const QgsGraphDirector* RoadGraphPlugin::director() const
{
- QString layerId;
QgsVectorLayer *layer = nullptr;
QMap< QString, QgsMapLayer* > mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
QMap< QString, QgsMapLayer* >::const_iterator it;
diff --git a/src/plugins/spatialquery/qgsspatialquerydialog.cpp b/src/plugins/spatialquery/qgsspatialquerydialog.cpp
index fdd5af407d73..19bbbaab7874 100644
--- a/src/plugins/spatialquery/qgsspatialquerydialog.cpp
+++ b/src/plugins/spatialquery/qgsspatialquerydialog.cpp
@@ -536,7 +536,6 @@ void QgsSpatialQueryDialog::populateCbTargetLayer()
QMapIterator item( layers );
QgsMapLayer * mapLayer = nullptr;
QgsVectorLayer * lyr = nullptr;
- QString layerId;
while ( item.hasNext() )
{
item.next();
diff --git a/src/providers/db2/qgsdb2dataitems.cpp b/src/providers/db2/qgsdb2dataitems.cpp
index 39da44082102..37c3144d6e36 100644
--- a/src/providers/db2/qgsdb2dataitems.cpp
+++ b/src/providers/db2/qgsdb2dataitems.cpp
@@ -170,9 +170,8 @@ QVector QgsDb2ConnectionItem::createChildren()
QSqlDatabase db = QgsDb2Provider::getDatabase( connInfo, errorMsg );
if ( errorMsg.isEmpty() )
{
- QString connectionName = db.connectionName();
//children.append( new QgsFavouritesItem(this, "connection successful", mPath + "/success"));
- QgsDebugMsg( "DB open successful for connection " + connectionName );
+ QgsDebugMsg( "DB open successful for connection " + db.connectionName() );
}
else
{
@@ -180,7 +179,7 @@ QVector QgsDb2ConnectionItem::createChildren()
QgsDebugMsg( "DB not open " + errorMsg );
return children;
}
- QString connectionName = db.connectionName();
+
QgsDb2GeometryColumns db2GC = QgsDb2GeometryColumns( db );
int sqlcode = db2GC.open();
@@ -295,10 +294,9 @@ void QgsDb2ConnectionItem::refreshConnection()
{
QString errMsg;
QSqlDatabase db = QgsDb2Provider::getDatabase( mConnInfo, errMsg );
-
+ Q_UNUSED( db );
if ( errMsg.isEmpty() )
{
- QString connectionName = db.connectionName();
QgsDebugMsg( "successful get db2 connection on refresh" );
}
else
diff --git a/src/providers/db2/qgsdb2expressioncompiler.cpp b/src/providers/db2/qgsdb2expressioncompiler.cpp
index 69e3143f6a62..299304f7c630 100644
--- a/src/providers/db2/qgsdb2expressioncompiler.cpp
+++ b/src/providers/db2/qgsdb2expressioncompiler.cpp
@@ -240,7 +240,6 @@ QString QgsDb2ExpressionCompiler::quotedValue( const QVariant& value, bool& ok )
return value.toBool() ? "(1=1)" : "(1=0)";
default:
- QString result = QgsSqlExpressionCompiler::quotedValue( value, ok );
return QgsSqlExpressionCompiler::quotedValue( value, ok );
}
}
diff --git a/src/providers/db2/qgsdb2featureiterator.cpp b/src/providers/db2/qgsdb2featureiterator.cpp
index 4966a0963553..07f858d0cca5 100644
--- a/src/providers/db2/qgsdb2featureiterator.cpp
+++ b/src/providers/db2/qgsdb2featureiterator.cpp
@@ -400,8 +400,7 @@ bool QgsDb2FeatureIterator::rewind()
QgsDebugMsg( "Execute mStatement: " + mStatement );
if ( !mQuery->exec( mStatement ) )
{
- QString msg = mQuery->lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( mQuery->lastError().text() );
close();
return false;
}
diff --git a/src/providers/db2/qgsdb2provider.cpp b/src/providers/db2/qgsdb2provider.cpp
index 8fb7b486871e..d6927b789dd4 100644
--- a/src/providers/db2/qgsdb2provider.cpp
+++ b/src/providers/db2/qgsdb2provider.cpp
@@ -278,7 +278,7 @@ void QgsDb2Provider::loadFields()
{
mAttributeFields.clear();
//mDefaultValues.clear();
- QString table = QString( "%1.%2" ).arg( mSchemaName ).arg( mTableName );
+ QString table = QString( "%1.%2" ).arg( mSchemaName, mTableName );
// Use the Qt functionality to get the fields and their definitions.
QSqlRecord r = mDatabase.record( table );
@@ -544,8 +544,7 @@ void QgsDb2Provider::updateStatistics()
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( !query.isActive() )
@@ -600,8 +599,7 @@ void QgsDb2Provider::updateStatistics()
if ( !query.exec( statement ) || !query.isActive() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.next() )
@@ -779,8 +777,7 @@ bool QgsDb2Provider::deleteFeatures( const QgsFeatureIds & id )
QgsDebugMsg( statement );
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -851,8 +848,7 @@ bool QgsDb2Provider::changeAttributeValues( const QgsChangedAttributesMap &attr_
// use prepared statement to prevent from sql injection
if ( !query.prepare( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
QgsDebugMsg( statement );
@@ -910,8 +906,7 @@ bool QgsDb2Provider::changeAttributeValues( const QgsChangedAttributesMap &attr_
if ( !query.exec() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
}
@@ -1244,8 +1239,7 @@ bool QgsDb2Provider::changeGeometryValues( const QgsGeometryMap &geometry_map )
QgsDebugMsg( statement );
if ( !query.prepare( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1255,8 +1249,7 @@ bool QgsDb2Provider::changeGeometryValues( const QgsGeometryMap &geometry_map )
if ( !query.exec() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
}
@@ -1310,8 +1303,7 @@ QgsVectorLayerImport::ImportError QgsDb2Provider::createEmptyLayer(
if ( !query.exec( statement ) || !query.isActive() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.next() )
@@ -1325,8 +1317,6 @@ QgsVectorLayerImport::ImportError QgsDb2Provider::createEmptyLayer(
}
}
- QString dbName = dsUri.database();
-
QString schemaName = dsUri.schema().toUpper();
QString tableName = dsUri.table().toUpper();
QString fullName;
@@ -1433,7 +1423,6 @@ QgsVectorLayerImport::ImportError QgsDb2Provider::createEmptyLayer(
int offset = 0;
// get the list of fields
- QList flist;
QgsDebugMsg( "PrimaryKey: '" + primaryKey + "'" );
for ( int i = 0; i < fieldCount; ++i )
{
diff --git a/src/providers/db2/qgsdb2sourceselect.cpp b/src/providers/db2/qgsdb2sourceselect.cpp
index cc1c83f03143..95a9f976bd35 100644
--- a/src/providers/db2/qgsdb2sourceselect.cpp
+++ b/src/providers/db2/qgsdb2sourceselect.cpp
@@ -499,7 +499,6 @@ void QgsDb2SourceSelect::on_btnConnect_clicked()
return;
}
- QString connectionName = db.connectionName();
QgsDb2GeometryColumns db2GC = QgsDb2GeometryColumns( db );
int sqlcode = db2GC.open();
if ( 0 != sqlcode )
@@ -716,8 +715,7 @@ void QgsDb2GeomColumnTypeThread::run()
QSqlDatabase db = QSqlDatabase::database( mConnectionName );
if ( !QgsDb2Provider::openDatabase( db ) )
{
- QString msg = db.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( db.lastError().text() );
continue;
}
@@ -725,8 +723,7 @@ void QgsDb2GeomColumnTypeThread::run()
q.setForwardOnly( true );
if ( !q.exec( query ) )
{
- QString msg = q.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( q.lastError().text() );
}
QString type;
diff --git a/src/providers/mssql/qgsmssqlfeatureiterator.cpp b/src/providers/mssql/qgsmssqlfeatureiterator.cpp
index 888251f34f89..301856122651 100644
--- a/src/providers/mssql/qgsmssqlfeatureiterator.cpp
+++ b/src/providers/mssql/qgsmssqlfeatureiterator.cpp
@@ -44,8 +44,7 @@ QgsMssqlFeatureIterator::QgsMssqlFeatureIterator( QgsMssqlFeatureSource* source,
if ( !mDatabase.open() )
{
QgsDebugMsg( "Failed to open database" );
- QString msg = mDatabase.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( mDatabase.lastError().text() );
return;
}
@@ -399,8 +398,7 @@ bool QgsMssqlFeatureIterator::rewind()
if ( !result )
{
- QString msg = mQuery->lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( mQuery->lastError().text() );
delete mQuery;
mQuery = nullptr;
if ( mDatabase.isOpen() )
diff --git a/src/providers/mssql/qgsmssqlprovider.cpp b/src/providers/mssql/qgsmssqlprovider.cpp
index 4bfdc57b4d98..420934c386b3 100644
--- a/src/providers/mssql/qgsmssqlprovider.cpp
+++ b/src/providers/mssql/qgsmssqlprovider.cpp
@@ -353,8 +353,7 @@ void QgsMssqlProvider::loadMetadata()
query.setForwardOnly( true );
if ( !query.exec( QString( "select f_geometry_column, coord_dimension, srid, geometry_type from geometry_columns where f_table_schema = '%1' and f_table_name = '%2'" ).arg( mSchemaName, mTableName ) ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() && query.next() )
{
@@ -373,8 +372,7 @@ void QgsMssqlProvider::loadFields()
query.setForwardOnly( true );
if ( !query.exec( QString( "exec sp_columns @table_name = N'%1', @table_owner = '%2'" ).arg( mTableName, mSchemaName ) ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text( ) );
return;
}
if ( query.isActive() )
@@ -447,8 +445,7 @@ void QgsMssqlProvider::loadFields()
query.setForwardOnly( true );
if ( !query.exec( QString( "exec sp_pkeys @table_name = N'%1', @table_owner = '%2' " ).arg( mTableName, mSchemaName ) ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() && query.next() )
{
@@ -462,8 +459,7 @@ void QgsMssqlProvider::loadFields()
if ( !query.exec( QString( "select count(distinct [%1]), count([%1]) from [%2].[%3]" )
.arg( pk, mSchemaName, mTableName ) ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() && query.next() && query.value( 0 ).toInt() == query.value( 1 ).toInt() )
{
@@ -512,8 +508,7 @@ QVariant QgsMssqlProvider::minimumValue( int index )
if ( !query.exec( sql ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() && query.next() )
@@ -544,8 +539,7 @@ QVariant QgsMssqlProvider::maximumValue( int index )
if ( !query.exec( sql ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() && query.next() )
@@ -585,8 +579,7 @@ void QgsMssqlProvider::uniqueValues( int index, QList &uniqueValues, i
if ( !query.exec( sql ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( query.isActive() )
@@ -666,8 +659,7 @@ void QgsMssqlProvider::UpdateStatistics( bool estimate )
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
}
if ( !query.isActive() )
@@ -851,8 +843,6 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
QgsDebugMsg( msg );
if ( !mSkipFailures )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
pushError( msg );
return false;
}
@@ -1016,8 +1006,7 @@ bool QgsMssqlProvider::addAttributes( const QList &attributes )
query.setForwardOnly( true );
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1051,8 +1040,7 @@ bool QgsMssqlProvider::deleteAttributes( const QgsAttributeIds &attributes )
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1119,8 +1107,7 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
// use prepared statement to prevent from sql injection
if ( !query.prepare( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1181,8 +1168,7 @@ bool QgsMssqlProvider::changeAttributeValues( const QgsChangedAttributesMap &att
if ( !query.exec() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
}
@@ -1239,8 +1225,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map
if ( !query.prepare( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1258,8 +1243,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map
if ( !query.exec() )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
}
@@ -1293,8 +1277,7 @@ bool QgsMssqlProvider::deleteFeatures( const QgsFeatureIds & id )
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1351,8 +1334,7 @@ bool QgsMssqlProvider::createSpatialIndex()
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
@@ -1380,8 +1362,7 @@ bool QgsMssqlProvider::createAttributeIndex( int field )
if ( !query.exec( statement ) )
{
- QString msg = query.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( query.lastError().text() );
return false;
}
diff --git a/src/providers/mssql/qgsmssqlsourceselect.cpp b/src/providers/mssql/qgsmssqlsourceselect.cpp
index d1062b5009c1..8bf4345f4fae 100644
--- a/src/providers/mssql/qgsmssqlsourceselect.cpp
+++ b/src/providers/mssql/qgsmssqlsourceselect.cpp
@@ -789,8 +789,7 @@ void QgsMssqlGeomColumnTypeThread::run()
QSqlDatabase db = QSqlDatabase::database( mConnectionName );
if ( !QgsMssqlProvider::OpenDatabase( db ) )
{
- QString msg = db.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( db.lastError().text() );
continue;
}
@@ -798,8 +797,7 @@ void QgsMssqlGeomColumnTypeThread::run()
q.setForwardOnly( true );
if ( !q.exec( query ) )
{
- QString msg = q.lastError().text();
- QgsDebugMsg( msg );
+ QgsDebugMsg( q.lastError().text() );
}
QString type;
diff --git a/src/providers/ogr/qgsogrdataitems.cpp b/src/providers/ogr/qgsogrdataitems.cpp
index 9f3f56e66785..7eed4cce6a73 100644
--- a/src/providers/ogr/qgsogrdataitems.cpp
+++ b/src/providers/ogr/qgsogrdataitems.cpp
@@ -372,8 +372,7 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
return nullptr;
}
- QString driverName = OGR_Dr_GetName( hDriver );
- QgsDebugMsgLevel( "OGR Driver : " + driverName, 2 );
+ QgsDebugMsgLevel( "OGR Driver : " + OGR_Dr_GetName( hDriver ), 2 );
int numLayers = OGR_DS_GetLayerCount( hDataSource );
diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp
index aedb95c91693..71d151d89531 100644
--- a/src/providers/spatialite/qgsspatialiteprovider.cpp
+++ b/src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -3501,7 +3501,6 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV
{
sqlite3_stmt *stmt = nullptr;
QString sql;
- QString txt;
uniqueValues.clear();
diff --git a/src/providers/spatialite/qgsspatialitetablemodel.cpp b/src/providers/spatialite/qgsspatialitetablemodel.cpp
index 86aafa79041e..482fd6ef48ab 100644
--- a/src/providers/spatialite/qgsspatialitetablemodel.cpp
+++ b/src/providers/spatialite/qgsspatialitetablemodel.cpp
@@ -53,8 +53,6 @@ void QgsSpatiaLiteTableModel::addTableEntry( const QString& type, const QString&
}
//path to icon for specified type
- QString typeName;
-
QGis::WkbType wkbType = qgisTypeFromDbType( type );
QIcon iconFile = iconForType( wkbType );
diff --git a/src/providers/virtual/qgsvirtuallayersqlitemodule.cpp b/src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
index e8fe1782befd..092575f8b8b4 100644
--- a/src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
+++ b/src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
@@ -337,7 +337,7 @@ int vtableCreateConnect( sqlite3* sql, void* aux, int argc, const char* const* a
}
QScopedPointer newVtab;
- QString vname( argv[2] );
+
int r;
if ( argc == 4 )
{
diff --git a/src/providers/wcs/qgswcsprovider.cpp b/src/providers/wcs/qgswcsprovider.cpp
index 7fbafa725153..11609df128e3 100644
--- a/src/providers/wcs/qgswcsprovider.cpp
+++ b/src/providers/wcs/qgswcsprovider.cpp
@@ -1910,7 +1910,7 @@ void QgsWcsDownloadHandler::cacheReplyFinished()
void QgsWcsDownloadHandler::cacheReplyProgress( qint64 bytesReceived, qint64 bytesTotal )
{
- QString msg = tr( "%1 of %2 bytes of map downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) );
- QgsDebugMsgLevel( msg, 3 );
- //emit statusChanged( msg );
+ Q_UNUSED( bytesReceived );
+ Q_UNUSED( bytesTotal );
+ QgsDebugMsgLevel( tr( "%1 of %2 bytes of map downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) ), 3 );
}
diff --git a/src/providers/wfs/qgswfsrequest.cpp b/src/providers/wfs/qgswfsrequest.cpp
index 5f8a6112456b..4fd19a20180a 100644
--- a/src/providers/wfs/qgswfsrequest.cpp
+++ b/src/providers/wfs/qgswfsrequest.cpp
@@ -183,8 +183,7 @@ void QgsWFSRequest::abort()
void QgsWFSRequest::replyProgress( qint64 bytesReceived, qint64 bytesTotal )
{
- QString msg = tr( "%1 of %2 bytes downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) );
- QgsDebugMsg( msg );
+ QgsDebugMsg( tr( "%1 of %2 bytes downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) ) );
if ( bytesReceived != 0 )
mGotNonEmptyResponse = true;
diff --git a/src/providers/wms/qgswmscapabilities.cpp b/src/providers/wms/qgswmscapabilities.cpp
index edc33fb0c2f6..9a46ae8b07f5 100644
--- a/src/providers/wms/qgswmscapabilities.cpp
+++ b/src/providers/wms/qgswmscapabilities.cpp
@@ -1370,8 +1370,10 @@ void QgsWmsCapabilities::parseWMTSContents( QDomElement const &e )
!e0.isNull();
e0 = e0.nextSiblingElement( "Layer" ) )
{
- QString id = e0.firstChildElement( "ows:Identifier" ).text();
+#ifdef QGISDEBUG
+ QString id = e0.firstChildElement( "ows:Identifier" ).text(); // clazy:exclude=unused-non-trivial-variable
QgsDebugMsg( QString( "Layer %1" ).arg( id ) );
+#endif
QgsWmtsTileLayer l;
l.tileMode = WMTS;
diff --git a/src/providers/wms/qgswmsprovider.cpp b/src/providers/wms/qgswmsprovider.cpp
index 4d9389592099..be006a7260ba 100644
--- a/src/providers/wms/qgswmsprovider.cpp
+++ b/src/providers/wms/qgswmsprovider.cpp
@@ -3301,8 +3301,9 @@ void QgsWmsImageDownloadHandler::cacheReplyFinished()
void QgsWmsImageDownloadHandler::cacheReplyProgress( qint64 bytesReceived, qint64 bytesTotal )
{
- QString msg = tr( "%1 of %2 bytes of map downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) );
- QgsDebugMsg( msg );
+ Q_UNUSED( bytesReceived );
+ Q_UNUSED( bytesTotal );
+ QgsDebugMsg( tr( "%1 of %2 bytes of map downloaded." ).arg( bytesReceived ).arg( bytesTotal < 0 ? QString( "unknown number of" ) : QString::number( bytesTotal ) ) );
}
diff --git a/src/server/qgssldconfigparser.cpp b/src/server/qgssldconfigparser.cpp
index 00a5ae472323..228244dbe5ae 100644
--- a/src/server/qgssldconfigparser.cpp
+++ b/src/server/qgssldconfigparser.cpp
@@ -466,7 +466,6 @@ QDomDocument QgsSLDConfigParser::getStyles( QStringList& layerList ) const
for ( int i = 0; i < layerList.size(); i++ )
{
QString layerName;
- QString typeName;
layerName = layerList.at( i );
QDomElement userLayerElement = findUserLayerElement( layerName );
if ( userLayerElement.isNull() )
@@ -1003,7 +1002,6 @@ bool QgsSLDConfigParser::labelSettingsFromUserStyle( const QDomElement& userStyl
int polyColorRed = 0;
int polyColorGreen = 0;
int polyColorBlue = 0;
- QString elemText;
QString fontfamily = QString( "Helvetica" );
QString fontstyle = QString( "Normal" );
int fontsize = 14;
diff --git a/src/server/qgswfsserver.cpp b/src/server/qgswfsserver.cpp
index 007dc9222c25..36328a82e256 100644
--- a/src/server/qgswfsserver.cpp
+++ b/src/server/qgswfsserver.cpp
@@ -1692,7 +1692,6 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
const QgsFields& fields = provider->fields();
QMap fieldMap = provider->fieldNameMap();
QMap::const_iterator fieldMapIt;
- QString fieldName;
// Loop through the insert elements
QDomNodeList inNodeList = typeNameElem.elementsByTagNameNS( WFS_NAMESPACE, "Insert" );
diff --git a/src/server/qgswmsconfigparser.cpp b/src/server/qgswmsconfigparser.cpp
index 576e63daabb1..e8448091c567 100644
--- a/src/server/qgswmsconfigparser.cpp
+++ b/src/server/qgswmsconfigparser.cpp
@@ -314,7 +314,6 @@ QStringList QgsWMSConfigParser::addHighlightLayers( const QMap
}
//create renderer from sld
- QString sld = symbolSplit[i];
QDomDocument sldDoc;
if ( !sldDoc.setContent( symbolSplit[i], true ) )
{