Skip to content

Commit

Permalink
Remove some unused variables
Browse files Browse the repository at this point in the history
Thanks to Clazy
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent be5d297 commit a4357e3
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -2125,7 +2125,6 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )

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

QFileDialog dlg( this, tr( "Export atlas to directory" ) );
dlg.setFileMode( QFileDialog::Directory );
Expand Down
7 changes: 3 additions & 4 deletions src/app/dwg/qgsdwgimporter.cpp
Expand Up @@ -215,7 +215,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
}

OGRFeatureDefnH dfn = OGR_L_GetLayerDefn( layer );
int pathIdx = OGR_FD_GetFieldIndex( dfn, "path" );
//int pathIdx = OGR_FD_GetFieldIndex( dfn, "path" );
int lastmodifiedIdx = OGR_FD_GetFieldIndex( dfn, "lastmodified" );

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

QString path = QString::fromUtf8( OGR_F_GetFieldAsString( f, pathIdx ) );

int year, month, day, hour, minute, second, tzf;
if ( !OGR_F_GetFieldAsDateTime( f, lastmodifiedIdx, &year, &month, &day, &hour, &minute, &second, &tzf ) )
{
Expand All @@ -241,9 +239,10 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
return false;
}

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

#if 0
QDateTime lastModified( QDate( year, month, day ), QTime( hour, minute, second ) );
QString path = QString::fromUtf8( OGR_F_GetFieldAsString( f, pathIdx ) );
if ( path == fi.canonicalPath() && fi.lastModified() <= lastModified )
{
LOG( QObject::tr( "Drawing already uptodate in database." ) );
Expand Down
3 changes: 1 addition & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -3354,8 +3354,7 @@ QgsMapCanvasDockWidget *QgisApp::createNewMapCanvasDock( const QString &name, bo
{
if ( canvas->objectName() == name )
{
QString errorMessage = tr( "A map canvas with name '%1' already exists!" ).arg( name );
QgsDebugMsg( errorMessage );
QgsDebugMsg( tr( "A map canvas with name '%1' already exists!" ).arg( name ) );
return nullptr;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgscrashreport.cpp
Expand Up @@ -125,8 +125,10 @@ const QString QgsCrashReport::crashID() const
// Hashes the full stack.
Q_FOREACH ( const QgsStackTrace::StackLine &line, mStackTrace )
{
#if 0
QFileInfo fileInfo( line.fileName );
QString filename( fileInfo.fileName() );
#endif
data += line.symbolName;
}

Expand Down
1 change: 0 additions & 1 deletion src/app/qgsfieldsproperties.cpp
Expand Up @@ -987,7 +987,6 @@ void QgsFieldsProperties::apply()
for ( int i = 0; i < mFieldsList->rowCount(); i++ )
{
int idx = mFieldsList->item( i, AttrIdCol )->text().toInt();
QString name = mLayer->fields().at( idx ).name();
FieldConfig cfg = configForRow( i );

editFormConfig.setReadOnly( idx, !cfg.mEditable );
Expand Down
1 change: 0 additions & 1 deletion src/app/qgslayerstylingwidget.cpp
Expand Up @@ -74,7 +74,6 @@ QgsLayerStylingWidget::QgsLayerStylingWidget( QgsMapCanvas *canvas, const QList<

mStyleManagerFactory = new QgsLayerStyleManagerWidgetFactory();

QList<QgsMapLayerConfigWidgetFactory *> l;
setPageFactories( pages );

connect( mUndoButton, &QAbstractButton::pressed, this, &QgsLayerStylingWidget::undo );
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgsselectbyformdialog.cpp
Expand Up @@ -67,8 +67,6 @@ void QgsSelectByFormDialog::setMapCanvas( QgsMapCanvas *canvas )

void QgsSelectByFormDialog::zoomToFeatures( const QString &filter )
{
QgsFeatureIds ids;

QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );

QgsFeatureRequest request = QgsFeatureRequest().setFilterExpression( filter )
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1285,7 +1285,6 @@ void QgsVectorLayerProperties::addJoinToTreeWidget( const QgsVectorLayerJoinInfo
QTreeWidgetItem *childFields = new QTreeWidgetItem();
childFields->setText( 0, "Joined fields" );
const QStringList *list = join.joinFieldNamesSubset();
QString fields;
if ( list )
childFields->setText( 1, QStringLiteral( "%1" ).arg( list->count() ) );
else
Expand Down
2 changes: 0 additions & 2 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -922,8 +922,6 @@ void QgsComposerMap::refreshMapExtents( const QgsExpressionContext *context )
const QgsExpressionContext *evalContext = context ? context : &scopedContext;

//data defined map extents set?
QVariant exprVal;

QgsRectangle newExtent = *currentMapExtent();
bool useDdXMin = false;
bool useDdXMax = false;
Expand Down
1 change: 0 additions & 1 deletion src/core/composer/qgscomposition.cpp
Expand Up @@ -3207,7 +3207,6 @@ void QgsComposition::refreshPageSize( const QgsExpressionContext *context )
double pageWidth = mPageWidth;
double pageHeight = mPageHeight;

QVariant exprVal;
//in order of precedence - first consider predefined page size
bool ok = false;
QString presetString = mDataDefinedProperties.valueAsString( QgsComposerObject::PresetPaperSize, *evalContext, QString(), &ok );
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -2156,7 +2156,6 @@ bool QgsProject::zip( const QString &filename )
archive->addFile( qgsFile.fileName() );

// zip
QString errMsg;
if ( !archive->zip( filename ) )
{
setError( tr( "Unable to perform zip" ) );
Expand Down
2 changes: 0 additions & 2 deletions src/core/scalebar/qgsnumericscalebarrenderer.cpp
Expand Up @@ -60,8 +60,6 @@ void QgsNumericScaleBarRenderer::draw( QgsRenderContext &context, const QgsScale
QSizeF QgsNumericScaleBarRenderer::calculateBoxSize( const QgsScaleBarSettings &settings,
const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const
{
QRectF rect;

double textWidth = QgsComposerUtils::textWidthMM( settings.font(), scaleText( scaleContext.scale ) );
double textHeight = QgsComposerUtils::fontAscentMM( settings.font() );

Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsexpressionselectiondialog.cpp
Expand Up @@ -124,8 +124,6 @@ void QgsExpressionSelectionDialog::on_mButtonZoomToFeatures_clicked()
if ( mExpressionBuilder->expressionText().isEmpty() || !mMapCanvas )
return;

QgsFeatureIds ids;

QgsExpressionContext context( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );

QgsFeatureRequest request = QgsFeatureRequest().setFilterExpression( mExpressionBuilder->expressionText() )
Expand Down
10 changes: 6 additions & 4 deletions src/gui/raster/qgsrendererrasterpropertieswidget.cpp
Expand Up @@ -365,13 +365,15 @@ void QgsRendererRasterPropertiesWidget::setRendererWidget( const QString &render
// Compare used bands in new and old renderer and reset transparency dialog if different
QgsRasterRenderer *oldRenderer = oldWidget->renderer();
QgsRasterRenderer *newRenderer = mRendererWidget->renderer();
#if 0
QList<int> oldBands = oldRenderer->usesBands();
QList<int> newBands = newRenderer->usesBands();

// if ( oldBands != newBands )
// {
// populateTransparencyTable( newRenderer );
// }
if ( oldBands != newBands )
{
populateTransparencyTable( newRenderer );
}
#endif

delete oldRenderer;
delete newRenderer;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology/qgsstylemanagerdialog.cpp
Expand Up @@ -1538,4 +1538,4 @@ void QgsStyleManagerDialog::onClose()
void QgsStyleManagerDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#the-style-manager" ) );
}
}
6 changes: 5 additions & 1 deletion src/providers/grass/qgsgrassimport.cpp
Expand Up @@ -435,14 +435,16 @@ bool QgsGrassRasterImport::import()
// TODO: best timeout?
mProcess->waitForFinished( 30000 );

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

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

if ( mProcess->exitStatus() != QProcess::NormalExit )
{
Expand Down Expand Up @@ -716,11 +718,13 @@ bool QgsGrassVectorImport::import()
QString stdoutString = mProcess->readAllStandardOutput().constData();
QString stderrString = mProcess->readAllStandardError().constData();

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

if ( mProcess->exitStatus() != QProcess::NormalExit )
{
Expand Down
9 changes: 3 additions & 6 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -2010,8 +2010,7 @@ QGISEXTERN bool saveStyle( const QString &uri, const QString &qmlStyle, const QS
query.setForwardOnly( true );
if ( !query.exec( QStringLiteral( "SELECT COUNT(*) FROM information_schema.tables WHERE table_name= N'layer_styles'" ) ) )
{
QString msg = query.lastError().text();
QgsDebugMsg( msg );
QgsDebugMsg( query.lastError().text() );
return false;
}
if ( query.isActive() && query.next() && query.value( 0 ).toInt() == 0 )
Expand Down Expand Up @@ -2265,8 +2264,7 @@ QGISEXTERN int listStyles( const QString &uri, QStringList &ids, QStringList &na
queryOk = query.exec( selectOthersQuery );
if ( !queryOk )
{
QString msg = query.lastError().text();
QgsDebugMsg( msg );
QgsDebugMsg( query.lastError().text() );
return -1;
}
QgsDebugMsg( query.isActive() && query.size() );
Expand Down Expand Up @@ -2299,8 +2297,7 @@ QGISEXTERN QString getStyleById( const QString &uri, QString styleId, QString &e
bool queryOk = query.exec( selectQmlQuery );
if ( !queryOk )
{
QString msg = query.lastError().text();
QgsDebugMsg( msg );
QgsDebugMsg( query.lastError().text() );
errCause = query.lastError().text();
return QString();
}
Expand Down
1 change: 0 additions & 1 deletion src/providers/virtual/qgsvirtuallayerprovider.cpp
Expand Up @@ -313,7 +313,6 @@ bool QgsVirtualLayerProvider::createIt()
}

QgsFields tfields;
QList<QString> geometryFields;
if ( !mDefinition.query().isEmpty() )
{
// look for column types of the query
Expand Down
2 changes: 0 additions & 2 deletions src/providers/wfs/qgswfsshareddata.cpp
Expand Up @@ -683,7 +683,6 @@ QString QgsWFSSharedData::findGmlId( QgsFeatureId fid )

QgsFeatureIterator iterGmlIds( mCacheDataProvider->getFeatures( request ) );
QgsFeature gmlidFeature;
QSet<QString> setExistingGmlIds;
while ( iterGmlIds.nextFeature( gmlidFeature ) )
{
const QVariant &v = gmlidFeature.attributes().value( gmlidIdx );
Expand Down Expand Up @@ -1281,7 +1280,6 @@ QgsRectangle QgsWFSSingleFeatureRequest::getExtent()
{
QVector<QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair> featurePtrList =
parser->getAndStealReadyFeatures();
QVector<QgsWFSFeatureGmlIdPair> featureList;
for ( int i = 0; i < featurePtrList.size(); i++ )
{
QgsGmlStreamingParser::QgsGmlFeaturePtrGmlIdPair &featPair = featurePtrList[i];
Expand Down

0 comments on commit a4357e3

Please sign in to comment.