Skip to content

Commit a4357e3

Browse files
committed
Remove some unused variables
Thanks to Clazy
1 parent be5d297 commit a4357e3

19 files changed

+21
-35
lines changed

src/app/composer/qgscomposer.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,6 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
21252125

21262126
QgsSettings myQSettings;
21272127
QString lastUsedDir = myQSettings.value( QStringLiteral( "UI/lastSaveAtlasAsImagesDir" ), QDir::homePath() ).toString();
2128-
QString lastUsedFormat = myQSettings.value( QStringLiteral( "UI/lastSaveAtlasAsImagesFormat" ), "jpg" ).toString();
21292128

21302129
QFileDialog dlg( this, tr( "Export atlas to directory" ) );
21312130
dlg.setFileMode( QFileDialog::Directory );

src/app/dwg/qgsdwgimporter.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
215215
}
216216

217217
OGRFeatureDefnH dfn = OGR_L_GetLayerDefn( layer );
218-
int pathIdx = OGR_FD_GetFieldIndex( dfn, "path" );
218+
//int pathIdx = OGR_FD_GetFieldIndex( dfn, "path" );
219219
int lastmodifiedIdx = OGR_FD_GetFieldIndex( dfn, "lastmodified" );
220220

221221
OGR_L_ResetReading( layer );
@@ -229,8 +229,6 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
229229
return false;
230230
}
231231

232-
QString path = QString::fromUtf8( OGR_F_GetFieldAsString( f, pathIdx ) );
233-
234232
int year, month, day, hour, minute, second, tzf;
235233
if ( !OGR_F_GetFieldAsDateTime( f, lastmodifiedIdx, &year, &month, &day, &hour, &minute, &second, &tzf ) )
236234
{
@@ -241,9 +239,10 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
241239
return false;
242240
}
243241

244-
QDateTime lastModified( QDate( year, month, day ), QTime( hour, minute, second ) );
245242

246243
#if 0
244+
QDateTime lastModified( QDate( year, month, day ), QTime( hour, minute, second ) );
245+
QString path = QString::fromUtf8( OGR_F_GetFieldAsString( f, pathIdx ) );
247246
if ( path == fi.canonicalPath() && fi.lastModified() <= lastModified )
248247
{
249248
LOG( QObject::tr( "Drawing already uptodate in database." ) );

src/app/qgisapp.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3354,8 +3354,7 @@ QgsMapCanvasDockWidget *QgisApp::createNewMapCanvasDock( const QString &name, bo
33543354
{
33553355
if ( canvas->objectName() == name )
33563356
{
3357-
QString errorMessage = tr( "A map canvas with name '%1' already exists!" ).arg( name );
3358-
QgsDebugMsg( errorMessage );
3357+
QgsDebugMsg( tr( "A map canvas with name '%1' already exists!" ).arg( name ) );
33593358
return nullptr;
33603359
}
33613360
}

src/app/qgscrashreport.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ const QString QgsCrashReport::crashID() const
125125
// Hashes the full stack.
126126
Q_FOREACH ( const QgsStackTrace::StackLine &line, mStackTrace )
127127
{
128+
#if 0
128129
QFileInfo fileInfo( line.fileName );
129130
QString filename( fileInfo.fileName() );
131+
#endif
130132
data += line.symbolName;
131133
}
132134

src/app/qgsfieldsproperties.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ void QgsFieldsProperties::apply()
987987
for ( int i = 0; i < mFieldsList->rowCount(); i++ )
988988
{
989989
int idx = mFieldsList->item( i, AttrIdCol )->text().toInt();
990-
QString name = mLayer->fields().at( idx ).name();
991990
FieldConfig cfg = configForRow( i );
992991

993992
editFormConfig.setReadOnly( idx, !cfg.mEditable );

src/app/qgslayerstylingwidget.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<
7474

7575
mStyleManagerFactory = new QgsLayerStyleManagerWidgetFactory();
7676

77-
QList<QgsMapLayerConfigWidgetFactory *> l;
7877
setPageFactories( pages );
7978

8079
connect( mUndoButton, &QAbstractButton::pressed, this, &QgsLayerStylingWidget::undo );

src/app/qgsselectbyformdialog.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ void QgsSelectByFormDialog::setMapCanvas( QgsMapCanvas *canvas )
6767

6868
void QgsSelectByFormDialog::zoomToFeatures( const QString &filter )
6969
{
70-
QgsFeatureIds ids;
71-
7270
QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );
7371

7472
QgsFeatureRequest request = QgsFeatureRequest().setFilterExpression( filter )

src/app/qgsvectorlayerproperties.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ void QgsVectorLayerProperties::addJoinToTreeWidget( const QgsVectorLayerJoinInfo
12851285
QTreeWidgetItem *childFields = new QTreeWidgetItem();
12861286
childFields->setText( 0, "Joined fields" );
12871287
const QStringList *list = join.joinFieldNamesSubset();
1288-
QString fields;
12891288
if ( list )
12901289
childFields->setText( 1, QStringLiteral( "%1" ).arg( list->count() ) );
12911290
else

src/core/composer/qgscomposermap.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,6 @@ void QgsComposerMap::refreshMapExtents( const QgsExpressionContext *context )
922922
const QgsExpressionContext *evalContext = context ? context : &scopedContext;
923923

924924
//data defined map extents set?
925-
QVariant exprVal;
926-
927925
QgsRectangle newExtent = *currentMapExtent();
928926
bool useDdXMin = false;
929927
bool useDdXMax = false;

src/core/composer/qgscomposition.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,6 @@ void QgsComposition::refreshPageSize( const QgsExpressionContext *context )
32073207
double pageWidth = mPageWidth;
32083208
double pageHeight = mPageHeight;
32093209

3210-
QVariant exprVal;
32113210
//in order of precedence - first consider predefined page size
32123211
bool ok = false;
32133212
QString presetString = mDataDefinedProperties.valueAsString( QgsComposerObject::PresetPaperSize, *evalContext, QString(), &ok );

src/core/qgsproject.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,6 @@ bool QgsProject::zip( const QString &filename )
21562156
archive->addFile( qgsFile.fileName() );
21572157

21582158
// zip
2159-
QString errMsg;
21602159
if ( !archive->zip( filename ) )
21612160
{
21622161
setError( tr( "Unable to perform zip" ) );

src/core/scalebar/qgsnumericscalebarrenderer.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ void QgsNumericScaleBarRenderer::draw( QgsRenderContext &context, const QgsScale
6060
QSizeF QgsNumericScaleBarRenderer::calculateBoxSize( const QgsScaleBarSettings &settings,
6161
const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const
6262
{
63-
QRectF rect;
64-
6563
double textWidth = QgsComposerUtils::textWidthMM( settings.font(), scaleText( scaleContext.scale ) );
6664
double textHeight = QgsComposerUtils::fontAscentMM( settings.font() );
6765

src/gui/qgsexpressionselectiondialog.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ void QgsExpressionSelectionDialog::on_mButtonZoomToFeatures_clicked()
124124
if ( mExpressionBuilder->expressionText().isEmpty() || !mMapCanvas )
125125
return;
126126

127-
QgsFeatureIds ids;
128-
129127
QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );
130128

131129
QgsFeatureRequest request = QgsFeatureRequest().setFilterExpression( mExpressionBuilder->expressionText() )

src/gui/raster/qgsrendererrasterpropertieswidget.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,15 @@ void QgsRendererRasterPropertiesWidget::setRendererWidget( const QString &render
365365
// Compare used bands in new and old renderer and reset transparency dialog if different
366366
QgsRasterRenderer *oldRenderer = oldWidget->renderer();
367367
QgsRasterRenderer *newRenderer = mRendererWidget->renderer();
368+
#if 0
368369
QList<int> oldBands = oldRenderer->usesBands();
369370
QList<int> newBands = newRenderer->usesBands();
370371

371-
// if ( oldBands != newBands )
372-
// {
373-
// populateTransparencyTable( newRenderer );
374-
// }
372+
if ( oldBands != newBands )
373+
{
374+
populateTransparencyTable( newRenderer );
375+
}
376+
#endif
375377

376378
delete oldRenderer;
377379
delete newRenderer;

src/gui/symbology/qgsstylemanagerdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1538,4 +1538,4 @@ void QgsStyleManagerDialog::onClose()
15381538
void QgsStyleManagerDialog::showHelp()
15391539
{
15401540
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#the-style-manager" ) );
1541-
}
1541+
}

src/providers/grass/qgsgrassimport.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,16 @@ bool QgsGrassRasterImport::import()
435435
// TODO: best timeout?
436436
mProcess->waitForFinished( 30000 );
437437

438-
QString stdoutString = mProcess->readAllStandardOutput().constData();
439438
QString stderrString = mProcess->readAllStandardError().constData();
440439

440+
#ifdef QGISDEBUG
441+
QString stdoutString = mProcess->readAllStandardOutput().constData();
441442
QString processResult = QStringLiteral( "exitStatus=%1, exitCode=%2, error=%3, errorString=%4 stdout=%5, stderr=%6" )
442443
.arg( mProcess->exitStatus() ).arg( mProcess->exitCode() )
443444
.arg( mProcess->error() ).arg( mProcess->errorString(),
444445
stdoutString.replace( QLatin1String( "\n" ), QLatin1String( ", " ) ), stderrString.replace( QLatin1String( "\n" ), QLatin1String( ", " ) ) );
445446
QgsDebugMsg( "processResult: " + processResult );
447+
#endif
446448

447449
if ( mProcess->exitStatus() != QProcess::NormalExit )
448450
{
@@ -716,11 +718,13 @@ bool QgsGrassVectorImport::import()
716718
QString stdoutString = mProcess->readAllStandardOutput().constData();
717719
QString stderrString = mProcess->readAllStandardError().constData();
718720

721+
#ifdef QGISDEBUG
719722
QString processResult = QStringLiteral( "exitStatus=%1, exitCode=%2, error=%3, errorString=%4 stdout=%5, stderr=%6" )
720723
.arg( mProcess->exitStatus() ).arg( mProcess->exitCode() )
721724
.arg( mProcess->error() ).arg( mProcess->errorString(),
722725
stdoutString.replace( QLatin1String( "\n" ), QLatin1String( ", " ) ), stderrString.replace( QLatin1String( "\n" ), QLatin1String( ", " ) ) );
723726
QgsDebugMsg( "processResult: " + processResult );
727+
#endif
724728

725729
if ( mProcess->exitStatus() != QProcess::NormalExit )
726730
{

src/providers/mssql/qgsmssqlprovider.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -2010,8 +2010,7 @@ QGISEXTERN bool saveStyle( const QString &uri, const QString &qmlStyle, const QS
20102010
query.setForwardOnly( true );
20112011
if ( !query.exec( QStringLiteral( "SELECT COUNT(*) FROM information_schema.tables WHERE table_name= N'layer_styles'" ) ) )
20122012
{
2013-
QString msg = query.lastError().text();
2014-
QgsDebugMsg( msg );
2013+
QgsDebugMsg( query.lastError().text() );
20152014
return false;
20162015
}
20172016
if ( query.isActive() && query.next() && query.value( 0 ).toInt() == 0 )
@@ -2265,8 +2264,7 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
22652264
queryOk = query.exec( selectOthersQuery );
22662265
if ( !queryOk )
22672266
{
2268-
QString msg = query.lastError().text();
2269-
QgsDebugMsg( msg );
2267+
QgsDebugMsg( query.lastError().text() );
22702268
return -1;
22712269
}
22722270
QgsDebugMsg( query.isActive() && query.size() );
@@ -2299,8 +2297,7 @@ QGISEXTERN QString getStyleById( const QString &uri, QString styleId, QString &e
22992297
bool queryOk = query.exec( selectQmlQuery );
23002298
if ( !queryOk )
23012299
{
2302-
QString msg = query.lastError().text();
2303-
QgsDebugMsg( msg );
2300+
QgsDebugMsg( query.lastError().text() );
23042301
errCause = query.lastError().text();
23052302
return QString();
23062303
}

src/providers/virtual/qgsvirtuallayerprovider.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ bool QgsVirtualLayerProvider::createIt()
313313
}
314314

315315
QgsFields tfields;
316-
QList<QString> geometryFields;
317316
if ( !mDefinition.query().isEmpty() )
318317
{
319318
// look for column types of the query

src/providers/wfs/qgswfsshareddata.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ QString QgsWFSSharedData::findGmlId( QgsFeatureId fid )
683683

684684
QgsFeatureIterator iterGmlIds( mCacheDataProvider->getFeatures( request ) );
685685
QgsFeature gmlidFeature;
686-
QSet<QString> setExistingGmlIds;
687686
while ( iterGmlIds.nextFeature( gmlidFeature ) )
688687
{
689688
const QVariant &v = gmlidFeature.attributes().value( gmlidIdx );
@@ -1281,7 +1280,6 @@ QgsRectangle QgsWFSSingleFeatureRequest::getExtent()
12811280
{
12821281
QVector<QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair> featurePtrList =
12831282
parser->getAndStealReadyFeatures();
1284-
QVector<QgsWFSFeatureGmlIdPair> featureList;
12851283
for ( int i = 0; i < featurePtrList.size(); i++ )
12861284
{
12871285
QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair &featPair = featurePtrList[i];

0 commit comments

Comments
 (0)