Skip to content
Permalink
Browse files

Remove some unused variables

Thanks to Clazy
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent be5d297 commit a4357e37fe8292114dcbc52ffe2fbcdf8902a804
@@ -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 );
@@ -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 );
@@ -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 ) )
{
@@ -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." ) );
@@ -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;
}
}
@@ -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;
}

@@ -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 );
@@ -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 );
@@ -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 )
@@ -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
@@ -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;
@@ -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 );
@@ -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" ) );
@@ -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() );

@@ -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() )
@@ -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;
@@ -1538,4 +1538,4 @@ void QgsStyleManagerDialog::onClose()
void QgsStyleManagerDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#the-style-manager" ) );
}
}
@@ -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 )
{
@@ -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 )
{
@@ -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 )
@@ -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() );
@@ -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();
}
@@ -313,7 +313,6 @@ bool QgsVirtualLayerProvider::createIt()
}

QgsFields tfields;
QList<QString> geometryFields;
if ( !mDefinition.query().isEmpty() )
{
// look for column types of the query
@@ -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 );
@@ -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];

0 comments on commit a4357e3

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