Skip to content
Permalink
Browse files

Merge pull request #5083 from nyalldawson/clazy

Clazy optimisations
  • Loading branch information
nyalldawson committed Aug 29, 2017
2 parents 51170ae + e4c1e1b commit f99a7a966ee5a7c2b1d1ed5f523f7ff917012f44
Showing with 771 additions and 664 deletions.
  1. +1 −1 python/core/core_auto.sip
  2. +2 −0 python/core/layertree/qgslayertreemodel.sip
  3. +1 −0 python/core/qgsdataitem.sip
  4. +0 −1 python/core/qgsdataprovider.sip
  5. +1 −0 python/gui/attributetable/qgsdualview.sip
  6. +1 −0 python/gui/qgscodeeditorsql.sip
  7. +1 −1 python/gui/qgsfontbutton.sip
  8. +1 −0 python/gui/symbology/qgsdatadefinedsizelegendwidget.sip
  9. +1 −1 scripts/sipify.pl
  10. +3 −3 src/analysis/interpolation/DualEdgeTriangulation.cc
  11. +1 −1 src/analysis/interpolation/qgsgridfilewriter.cpp
  12. +3 −3 src/analysis/network/qgsvectorlayerdirector.cpp
  13. +3 −4 src/app/composer/qgscomposer.cpp
  14. +1 −1 src/app/composer/qgscompositionwidget.cpp
  15. +0 −7 src/app/dwg/libdxfrw/drw_base.h
  16. +3 −3 src/app/dwg/qgsdwgimportdialog.cpp
  17. +16 −23 src/app/dwg/qgsdwgimporter.cpp
  18. +1 −2 src/app/qgisapp.cpp
  19. +2 −2 src/app/qgsabout.cpp
  20. +2 −2 src/app/qgsbookmarks.cpp
  21. +3 −1 src/app/qgscrashreport.cpp
  22. +1 −1 src/app/qgscustomization.cpp
  23. +2 −0 src/app/qgsdiagramproperties.h
  24. +0 −1 src/app/qgsfieldsproperties.cpp
  25. +2 −2 src/app/qgsidentifyresultsdialog.cpp
  26. +2 −1 src/app/qgsjoindialog.cpp
  27. +0 −1 src/app/qgslayerstylingwidget.cpp
  28. +1 −1 src/app/qgsmaplayerstyleguiutils.cpp
  29. +2 −1 src/app/qgsmaptooladdpart.cpp
  30. +2 −2 src/app/qgsmaptoolidentifyaction.cpp
  31. +6 −3 src/app/qgsmeasuredialog.cpp
  32. +0 −2 src/app/qgsselectbyformdialog.cpp
  33. +0 −1 src/app/qgsvectorlayerproperties.cpp
  34. +3 −2 src/core/CMakeLists.txt
  35. +1 −2 src/core/auth/qgsauthmanager.cpp
  36. +1 −1 src/core/auth/qgsauthmanager.h
  37. +4 −3 src/core/composer/qgscomposerattributetablev2.cpp
  38. +0 −2 src/core/composer/qgscomposermap.cpp
  39. +0 −1 src/core/composer/qgscomposition.cpp
  40. +1 −1 src/core/expression/qgsexpressionnodeimpl.cpp
  41. +1 −1 src/core/geometry/qgsgeometryeditutils.cpp
  42. +0 −30 src/core/layertree/qgslayertreemodel.cpp
  43. +35 −1 src/core/layertree/qgslayertreemodel.h
  44. +4 −2 src/core/layertree/qgslayertreemodellegendnode.h
  45. +2 −0 src/core/layout/qgslayoutitemregistry.h
  46. +2 −0 src/core/processing/qgsnativealgorithms.h
  47. +1 −1 src/core/processing/qgsprocessingparameters.cpp
  48. +1 −1 src/core/providers/memory/qgsmemoryproviderutils.cpp
  49. +1 −0 src/core/qgsapplication.cpp
  50. +1 −1 src/core/qgsattributetableconfig.cpp
  51. +2 −2 src/core/qgsbrowsermodel.cpp
  52. +10 −10 src/core/qgscolorscheme.cpp
  53. +1 −3 src/core/qgsdataitem.cpp
  54. +6 −4 src/core/qgsdataitem.h
  55. +1 −2 src/core/qgsdataprovider.h
  56. +1 −1 src/core/qgsdistancearea.cpp
  57. +1 −1 src/core/qgsgml.cpp
  58. +1 −1 src/core/qgsjsonutils.cpp
  59. +0 −1 src/core/qgsmessagelog.cpp
  60. +1 −1 src/core/qgsmessagelog.h
  61. +3 −1 src/core/qgsnetworkdiskcache.cpp
  62. +13 −8 src/core/qgsnetworkdiskcache.h
  63. +5 −4 src/core/qgsofflineediting.cpp
  64. +9 −9 src/core/qgsogcutils.cpp
  65. +1 −2 src/core/qgsproject.cpp
  66. +7 −3 src/core/qgsprojectproperty.cpp
  67. +1 −2 src/core/qgsruntimeprofiler.cpp
  68. +4 −4 src/core/qgsstacktrace.cpp
  69. +5 −0 src/core/qgsunittypes.h
  70. +1 −1 src/core/qgsvectordataprovider.cpp
  71. +5 −4 src/core/qgsvectorlayer.cpp
  72. +2 −2 src/core/qgsvectorlayereditbuffer.cpp
  73. +4 −2 src/core/qgsvectorlayerjoinbuffer.cpp
  74. +2 −1 src/core/qgsvectorlayerjoininfo.cpp
  75. +1 −1 src/core/qgsvectorlayerlabeling.cpp
  76. +4 −2 src/core/qgsvirtuallayerdefinitionutils.cpp
  77. +1 −1 src/core/qgsziputils.cpp
  78. +3 −3 src/core/raster/qgscolorrampshader.cpp
  79. +2 −0 src/core/raster/qgsrasterinterface.h
  80. +39 −32 src/core/raster/qgsrasterlayerrenderer.cpp
  81. +29 −23 src/core/raster/qgsrasterlayerrenderer.h
  82. +0 −2 src/core/scalebar/qgsnumericscalebarrenderer.cpp
  83. +3 −3 src/core/symbology/qgs25drenderer.cpp
  84. +3 −3 src/core/symbology/qgssymbollayerutils.cpp
  85. +2 −1 src/gui/attributetable/qgsdualview.h
  86. +2 −2 src/gui/attributetable/qgsfeaturelistmodel.cpp
  87. +1 −1 src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
  88. +4 −0 src/gui/locator/qgslocatorwidget.h
  89. +2 −2 src/gui/qgsadvanceddigitizingdockwidget.cpp
  90. +2 −1 src/gui/qgsattributeform.cpp
  91. +5 −5 src/gui/qgscodeeditor.cpp
  92. +1 −1 src/gui/qgscodeeditorpython.cpp
  93. +0 −17 src/gui/qgscodeeditorsql.cpp
  94. +25 −0 src/gui/qgscodeeditorsql.h
  95. +1 −1 src/gui/qgscolorbutton.h
  96. +1 −1 src/gui/qgsexpressionbuilderwidget.cpp
  97. +0 −2 src/gui/qgsexpressionselectiondialog.cpp
  98. +5 −2 src/gui/qgsfilewidget.cpp
  99. +1 −1 src/gui/qgsfilterlineedit.h
  100. +1 −1 src/gui/qgsfloatingwidget.h
  101. +2 −2 src/gui/qgsfontbutton.h
  102. +1 −1 src/gui/qgshelp.cpp
  103. +2 −2 src/gui/qgskeyvaluewidget.cpp
  104. +2 −2 src/gui/qgslistwidget.cpp
  105. +1 −1 src/gui/qgsmaptoolcapture.cpp
  106. +4 −3 src/gui/qgsmaptoolidentify.cpp
  107. +1 −1 src/gui/qgsmessagebar.cpp
  108. +1 −2 src/gui/qgsmessagelogviewer.cpp
  109. +1 −1 src/gui/qgsoptionsdialogbase.cpp
  110. +2 −2 src/gui/qgsowssourceselect.cpp
  111. +6 −4 src/gui/raster/qgsrendererrasterpropertieswidget.cpp
  112. +0 −23 src/gui/symbology/qgsdatadefinedsizelegendwidget.cpp
  113. +27 −0 src/gui/symbology/qgsdatadefinedsizelegendwidget.h
  114. +2 −1 src/gui/symbology/qgspointdisplacementrendererwidget.cpp
  115. +1 −1 src/gui/symbology/qgsrulebasedrendererwidget.cpp
  116. +1 −1 src/gui/symbology/qgsstyleexportimportdialog.cpp
  117. +2 −2 src/gui/symbology/qgsstylemanagerdialog.cpp
  118. +1 −1 src/gui/symbology/qgssymbolslistwidget.cpp
  119. +31 −31 src/plugins/gps_importer/qgsgpsplugin.cpp
  120. +5 −1 src/plugins/grass/qgsgrassmoduleinput.h
  121. +87 −103 src/plugins/grass/qgsgrasstools.cpp
  122. +37 −0 src/plugins/grass/qgsgrasstools.h
  123. +1 −1 src/plugins/topology/checkDock.cpp
  124. +11 −11 src/plugins/topology/topolTest.cpp
  125. +2 −0 src/providers/arcgisrest/qgsafsdataitems.h
  126. +2 −2 src/providers/arcgisrest/qgsafsshareddata.cpp
  127. +2 −0 src/providers/arcgisrest/qgsamsdataitems.h
  128. +2 −15 src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp
  129. +14 −0 src/providers/arcgisrest/qgsarcgisservicesourceselect.h
  130. +1 −1 src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
  131. +10 −10 src/providers/gdal/qgsgdalprovider.cpp
  132. +6 −6 src/providers/gpx/gpsdata.cpp
  133. +1 −0 src/providers/grass/CMakeLists.txt
  134. +3 −1 src/providers/grass/qgsgrass.cpp
  135. +2 −0 src/providers/grass/qgsgrassdatafile.h
  136. +5 −1 src/providers/grass/qgsgrassimport.cpp
  137. +2 −0 src/providers/grass/qgsgrassprovidermodule.h
  138. +4 −4 src/providers/grass/qgsgrassvectormaplayer.cpp
  139. +1 −1 src/providers/grass/qgsgrassvectormaplayer.h
  140. +3 −6 src/providers/mssql/qgsmssqlprovider.cpp
  141. +3 −2 src/providers/ogr/qgsgeopackagedataitems.cpp
  142. +2 −2 src/providers/ogr/qgsogrconnpool.h
  143. +1 −1 src/providers/ogr/qgsogrfeatureiterator.cpp
  144. +2 −2 src/providers/ogr/qgsogrprovider.cpp
  145. +1 −1 src/providers/spatialite/qgsspatialitedataitems.cpp
  146. +0 −1 src/providers/virtual/qgsvirtuallayerprovider.cpp
  147. +1 −0 src/providers/wfs/CMakeLists.txt
  148. +2 −0 src/providers/wfs/qgswfsconnection.h
  149. +1 −1 src/providers/wfs/qgswfsprovider.cpp
  150. +1 −3 src/providers/wfs/qgswfsshareddata.cpp
  151. +3 −31 src/providers/wfs/qgswfssourceselect.cpp
  152. +32 −1 src/providers/wfs/qgswfssourceselect.h
  153. +3 −3 src/providers/wms/qgswmssourceselect.cpp
  154. +1 −1 tests/code_layout/doxygen_parser.py
  155. +0 −1 tests/src/analysis/testqgsrastercalculator.cpp
  156. +82 −72 tests/src/core/testqgslayoutitem.cpp
@@ -198,7 +198,6 @@
%Include raster/qgsrasterfilewriter.sip
%Include raster/qgsrasterhistogram.sip
%Include raster/qgsrasteridentifyresult.sip
%Include raster/qgsrasterinterface.sip
%Include raster/qgsrasteriterator.sip
%Include raster/qgsrasterminmaxorigin.sip
%Include raster/qgsrasternuller.sip
@@ -377,6 +376,7 @@
%Include raster/qgsrasterfilewritertask.sip
%Include raster/qgsrasterlayer.sip
%Include raster/qgsrasterdataprovider.sip
%Include raster/qgsrasterinterface.sip
%Include geometry/qgspoint.sip
%Include gps/qgsgpsconnection.sip
%Include gps/qgsgpsdetector.sip
@@ -385,6 +385,8 @@ Filter nodes from QgsMapLayerLegend according to the current filtering rules
QFlags<QgsLayerTreeModel::Flag> operator|(QgsLayerTreeModel::Flag f1, QFlags<QgsLayerTreeModel::Flag> f2);




/************************************************************************
* This file has been generated automatically from *
* *
@@ -52,6 +52,7 @@ class QgsDataItem : QObject
Project
};


QgsDataItem( QgsDataItem::Type type, QgsDataItem *parent /TransferThis/, const QString &name, const QString &path );
%Docstring
Create new data item.
@@ -46,7 +46,6 @@ class QgsDataProvider : QObject
%End
public:


enum DataCapability
{
NoDataCapabilities,
@@ -34,6 +34,7 @@ class QgsDualView : QStackedWidget
AttributeEditor
};


explicit QgsDualView( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor
@@ -28,6 +28,7 @@ class QgsCodeEditorSQL : QgsCodeEditor

};


/************************************************************************
* This file has been generated automatically from *
* *
@@ -31,13 +31,13 @@ class QgsFontButton : QToolButton
%End
public:


enum Mode
{
ModeTextRenderer,
ModeQFont,
};


QgsFontButton( QWidget *parent /TransferThis/ = 0, const QString &dialogTitle = QString() );
%Docstring
Construct a new font button.
@@ -40,6 +40,7 @@ Returns configuration as set up in the dialog (may be null). Ownership is passed

};


/************************************************************************
* This file has been generated automatically from *
* *
@@ -464,7 +464,7 @@ sub detect_comment_block{
next;
}
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET etc.
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED|NOWARN_DEPRECATED_(PUSH|POP)).*?$/){
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|ENUM|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED|NOWARN_DEPRECATED_(PUSH|POP)).*?$/){
next;
}

@@ -1545,18 +1545,18 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )


//setNext and setPoint for the forced edge because this would disturb the building of 'leftpoly' and 'rightpoly' otherwise
mHalfEdge[leftPolygon.first()]->setNext( ( *( ++( leftiter = leftPolygon.begin() ) ) ) );
mHalfEdge[leftPolygon.first()]->setNext( ( *( ++( leftiter = leftPolygon.constBegin() ) ) ) );
mHalfEdge[leftPolygon.first()]->setPoint( p2 );
mHalfEdge[leftPolygon.last()]->setNext( firstedge );
mHalfEdge[rightPolygon.first()]->setNext( ( *( ++( rightiter = rightPolygon.begin() ) ) ) );
mHalfEdge[rightPolygon.first()]->setNext( ( *( ++( rightiter = rightPolygon.constBegin() ) ) ) );
mHalfEdge[rightPolygon.first()]->setPoint( p1 );
mHalfEdge[rightPolygon.last()]->setNext( dualfirstedge );

triangulatePolygon( &leftPolygon, &freelist, firstedge );
triangulatePolygon( &rightPolygon, &freelist, dualfirstedge );

//optimisation of the new edges
for ( iter = crossedEdges.begin(); iter != crossedEdges.end(); ++iter )
for ( iter = crossedEdges.constBegin(); iter != crossedEdges.constEnd(); ++iter )
{
checkSwap( ( *( iter ) ), 0 );
}
@@ -98,7 +98,7 @@ int QgsGridFileWriter::writeFile( QgsFeedback *feedback )

// create prj file
QgsInterpolator::LayerData ld;
ld = mInterpolator->layerData().first();
ld = mInterpolator->layerData().at( 0 );
QgsVectorLayer *vl = ld.vectorLayer;
QString crs = vl->crs().toWkt();
QFileInfo fi( mOutputFilePath );
@@ -255,18 +255,18 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
QList< QgsNetworkStrategy * >::const_iterator it;
QgsAttributeList::const_iterator it2;

for ( it = mStrategies.begin(); it != mStrategies.end(); ++it )
for ( it = mStrategies.constBegin(); it != mStrategies.constEnd(); ++it )
{
QgsAttributeList tmp = ( *it )->requiredAttributes();
for ( it2 = tmp.begin(); it2 != tmp.end(); ++it2 )
for ( it2 = tmp.constBegin(); it2 != tmp.constEnd(); ++it2 )
{
tmpAttr.push_back( *it2 );
}
}
std::sort( tmpAttr.begin(), tmpAttr.end() );

int lastAttrId = -1;
for ( it2 = tmpAttr.begin(); it2 != tmpAttr.end(); ++it2 )
for ( it2 = tmpAttr.constBegin(); it2 != tmpAttr.constEnd(); ++it2 )
{
if ( *it2 == lastAttrId )
{
@@ -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 );
@@ -2696,8 +2695,8 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
&& !mComposition->gridVisible() ) items.pop_back();
QgsItemTempHider itemsHider( items );
int composerItemLayerIdx = 0;
QList<QGraphicsItem *>::const_iterator it = items.begin();
for ( unsigned svgLayerId = 1; it != items.end(); ++svgLayerId )
QList<QGraphicsItem *>::const_iterator it = items.constBegin();
for ( unsigned svgLayerId = 1; it != items.constEnd(); ++svgLayerId )
{
itemsHider.hideAll();
QgsComposerItem *composerItem = dynamic_cast<QgsComposerItem *>( *it );
@@ -2711,7 +2710,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
else
{
// show all items until the next item that renders on a separate layer
for ( ; it != items.end(); ++it )
for ( ; it != items.constEnd(); ++it )
{
composerItem = dynamic_cast<QgsComposerMap *>( *it );
if ( composerItem && composerItem->numberExportLayers() )
@@ -269,7 +269,7 @@ void QgsCompositionWidget::createPaperEntries()
;
mPaperSizeComboBox->addItem( tr( "Custom" ) );

for ( QList<QgsCompositionPaper>::const_iterator it = formats.begin(); it != formats.end(); ++it )
for ( QList<QgsCompositionPaper>::const_iterator it = formats.constBegin(); it != formats.constEnd(); ++it )
{
mPaperSizeComboBox->addItem( it->mName );
mPaperMap.insert( it->mName, *it );
@@ -158,13 +158,6 @@ class DRW_Coord
DRW_Coord(): x( 0 ), y( 0 ), z( 0 ) {}
DRW_Coord( double ix, double iy, double iz ): x( ix ), y( iy ), z( iz ) {}

DRW_Coord &operator = ( const DRW_Coord &data )
{
x = data.x;
y = data.y;
z = data.z;
return *this;
}
//! < convert to unitary vector
void unitize()
{
@@ -151,7 +151,7 @@ void QgsDwgImportDialog::on_leLayerGroup_textChanged( const QString &text )

void QgsDwgImportDialog::on_pbLoadDatabase_clicked()
{
if ( !QFileInfo( leDatabase->text() ).exists() )
if ( !QFileInfo::exists( leDatabase->text() ) )
return;

CursorOverride waitCursor;
@@ -269,7 +269,7 @@ void QgsDwgImportDialog::on_pbImportDrawing_clicked()

QgsVectorLayer *QgsDwgImportDialog::layer( QgsLayerTreeGroup *layerGroup, QString layerFilter, QString table )
{
QgsVectorLayer *l = new QgsVectorLayer( QString( "%1|layername=%2" ).arg( leDatabase->text() ).arg( table ), table, "ogr", false );
QgsVectorLayer *l = new QgsVectorLayer( QString( "%1|layername=%2" ).arg( leDatabase->text(), table ), table, "ogr", false );
l->setSubsetString( QString( "%1space=0 AND block=-1" ).arg( layerFilter ) );

if ( l->featureCount() == 0 )
@@ -471,7 +471,7 @@ void QgsDwgImportDialog::on_buttonBox_accepted()
QgsLayerTreeGroup *dwgGroup = QgisApp::instance()->layerTreeView()->layerTreeModel()->rootGroup()->addGroup( leLayerGroup->text() );
Q_ASSERT( dwgGroup );

Q_FOREACH ( QString layer, layers.keys() )
Q_FOREACH ( const QString &layer, layers.keys() )
{
createGroup( dwgGroup, layer, QStringList( layer ), layers[layer] );
}
@@ -99,9 +99,7 @@ bool QgsDwgImporter::exec( QString sql, bool logError )
if ( logError )
{
LOG( QObject::tr( "SQL statement failed\nDatabase:%1\nSQL:%2\nError:%3" )
.arg( mDatabase )
.arg( sql )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
.arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
}
return false;
}
@@ -127,9 +125,7 @@ OGRLayerH QgsDwgImporter::query( QString sql )
return layer;

LOG( QObject::tr( "SQL statement failed\nDatabase:%1\nSQL:%2\nError:%3" )
.arg( mDatabase )
.arg( sql )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
.arg( mDatabase, sql, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );

OGR_DS_ReleaseResultSet( mDs, layer );

@@ -145,8 +141,7 @@ void QgsDwgImporter::startTransaction()
if ( !mInTransaction )
{
LOG( QObject::tr( "Could not start transaction\nDatabase:%1\nError:%2" )
.arg( mDatabase )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
.arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
}
}

@@ -157,8 +152,7 @@ void QgsDwgImporter::commitTransaction()
if ( mInTransaction && GDALDatasetCommitTransaction( mDs ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not commit transaction\nDatabase:%1\nError:%2" )
.arg( mDatabase )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
.arg( mDatabase, QString::fromUtf8( CPLGetLastErrorMsg() ) ) );
}
mInTransaction = false;
}
@@ -201,7 +195,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
return false;
}

if ( QFileInfo( mDatabase ).exists() )
if ( QFileInfo::exists( mDatabase ) )
{
mDs = OGROpen( mDatabase.toUtf8().constData(), true, nullptr );
if ( !mDs )
@@ -221,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 );
@@ -235,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 ) )
{
@@ -247,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." ) );
@@ -608,7 +601,7 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa

OGR_F_Destroy( f );

LOG( QObject::tr( "Updating database from %1 [%2]." ).arg( drawing ).arg( fi.lastModified().toString() ) );
LOG( QObject::tr( "Updating database from %1 [%2]." ).arg( drawing, fi.lastModified().toString() ) );

DRW::error result( DRW::BAD_NONE );

@@ -752,9 +745,9 @@ void QgsDwgImporter::addHeader( const DRW_Header *data )

case DRW_Variant::COORD:
v = QString( "%1,%2,%3" )
.arg( qgsDoubleToString( it->second->content.v->x ) )
.arg( qgsDoubleToString( it->second->content.v->y ) )
.arg( qgsDoubleToString( it->second->content.v->z ) );
.arg( qgsDoubleToString( it->second->content.v->x ),
qgsDoubleToString( it->second->content.v->y ),
qgsDoubleToString( it->second->content.v->z ) );
break;

case DRW_Variant::INVALID:
@@ -767,9 +760,9 @@ void QgsDwgImporter::addHeader( const DRW_Header *data )
if ( OGR_L_CreateFeature( layer, f ) != OGRERR_NONE )
{
LOG( QObject::tr( "Could not add %3 %1 [%2]" )
.arg( k )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) )
.arg( QObject::tr( "header record" ) )
.arg( k,
QString::fromUtf8( CPLGetLastErrorMsg() ),
QObject::tr( "header record" ) )
);
}

@@ -2612,7 +2605,7 @@ bool QgsDwgImporter::expandInserts( QString &error )
QTransform t;
t.translate( p.x(), p.y() ).scale( xscale, yscale ).rotateRadians( angle );

Q_FOREACH ( QString name, QStringList() << "hatches" << "lines" << "polylines" << "texts" << "points" )
Q_FOREACH ( const QString &name, QStringList() << "hatches" << "lines" << "polylines" << "texts" << "points" )
{
OGRLayerH src = OGR_DS_ExecuteSQL( mDs, QString( "SELECT * FROM %1 WHERE block=%2" ).arg( name ).arg( handle ).toUtf8().constData(), nullptr, nullptr );
if ( !src )
@@ -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;
}
}
@@ -255,8 +255,8 @@ void QgsAbout::setPluginInfo()
myString += QApplication::libraryPaths().join( QStringLiteral( "<br>" ) );
myString += QLatin1String( "<ol>\n<li>\n" );
QList<QByteArray> myImageFormats = QImageReader::supportedImageFormats();
QList<QByteArray>::const_iterator myIterator = myImageFormats.begin();
while ( myIterator != myImageFormats.end() )
QList<QByteArray>::const_iterator myIterator = myImageFormats.constBegin();
while ( myIterator != myImageFormats.constEnd() )
{
QString myFormat = ( *myIterator ).data();
myString += myFormat + "</li>\n<li>";
@@ -445,10 +445,10 @@ bool QgsProjectBookmarksTableModel::setData( const QModelIndex &index, const QVa
switch ( index.column() )
{
case 1:
QgsProject::instance()->writeEntry( QStringLiteral( "Bookmarks" ), QStringLiteral( "/Row-%1/Name" ).arg( index.row() ), value.value<QString>() );
QgsProject::instance()->writeEntry( QStringLiteral( "Bookmarks" ), QStringLiteral( "/Row-%1/Name" ).arg( index.row() ), value.toString() );
return true;
case 2:
QgsProject::instance()->writeEntry( QStringLiteral( "Bookmarks" ), QStringLiteral( "/Row-%1/Project" ).arg( index.row() ), value.value<QString>() );
QgsProject::instance()->writeEntry( QStringLiteral( "Bookmarks" ), QStringLiteral( "/Row-%1/Project" ).arg( index.row() ), value.toString() );
return true;
case 3:
QgsProject::instance()->writeEntry( QStringLiteral( "Bookmarks" ), QStringLiteral( "/Row-%1/MinX" ).arg( index.row() ), value.toDouble() );
@@ -108,7 +108,7 @@ const QString QgsCrashReport::toHtml() const
}

QString report;
Q_FOREACH ( QString line, reportData )
Q_FOREACH ( const QString &line, reportData )
{
report += line + "<br>";
}
@@ -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;
}

0 comments on commit f99a7a9

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