Skip to content
Permalink
Browse files

Add missing QStringLiterals

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent 60b8ec5 commit 31c1ae1c6af87d253a055b9acda89f440dc68d0e
Showing with 1,433 additions and 1,314 deletions.
  1. +2 −0 src/analysis/network/qgsgraphbuilder.h
  2. +2 −0 src/analysis/network/qgsgraphbuilderinterface.h
  3. +1 −1 src/analysis/openstreetmap/qgsosmdownload.cpp
  4. +3 −1 src/analysis/vector/qgszonalstatistics.h
  5. +1 −1 src/app/composer/qgscomposer.cpp
  6. +1 −1 src/app/dwg/libdxfrw/drw_entities.cpp
  7. +2 −2 src/app/dwg/libdxfrw/drw_header.cpp
  8. +1 −1 src/app/dwg/libdxfrw/drw_objects.cpp
  9. +5 −5 src/app/dwg/libdxfrw/intern/drw_dbg.cpp
  10. +1 −1 src/app/dwg/libdxfrw/intern/dwgreader.cpp
  11. +36 −36 src/app/dwg/qgsdwgimportdialog.cpp
  12. +209 −209 src/app/dwg/qgsdwgimporter.cpp
  13. +1 −1 src/app/layout/qgslayoutdesignerdialog.cpp
  14. +6 −6 src/app/main.cpp
  15. +1 −1 src/app/nodetool/qgsnodetool.cpp
  16. +3 −1 src/app/pluginmanager/qgspluginsortfilterproxymodel.h
  17. +9 −9 src/app/qgisapp.cpp
  18. +2 −0 src/app/qgisapp.h
  19. +4 −4 src/app/qgsattributeactionpropertiesdialog.cpp
  20. +4 −4 src/app/qgscrashdialog.cpp
  21. +22 −22 src/app/qgscrashreport.cpp
  22. +1 −1 src/app/qgsdecorationcopyright.cpp
  23. +1 −1 src/app/qgsdecorationlayoutextentdialog.cpp
  24. +3 −3 src/app/qgsfeatureaction.cpp
  25. +2 −2 src/app/qgsidentifyresultsdialog.cpp
  26. +2 −2 src/app/qgsmapsavedialog.cpp
  27. +2 −2 src/app/qgsoptions.cpp
  28. +4 −1 src/app/qgspluginregistry.h
  29. +2 −2 src/app/qgsprojectproperties.cpp
  30. +2 −2 src/app/qgsrasterlayerproperties.cpp
  31. +1 −1 src/app/qgssnappingwidget.cpp
  32. +13 −13 src/app/qgsvectorlayerproperties.cpp
  33. +4 −4 src/core/auth/qgsauthmanager.cpp
  34. +3 −3 src/core/auth/qgsauthmethodregistry.cpp
  35. +1 −1 src/core/composer/qgscomposerattributetablev2.cpp
  36. +1 −1 src/core/composer/qgscomposerlegend.cpp
  37. +2 −2 src/core/composer/qgscomposerpicture.cpp
  38. +5 −0 src/core/diagram/qgshistogramdiagram.cpp
  39. +1 −1 src/core/diagram/qgshistogramdiagram.h
  40. +5 −0 src/core/diagram/qgspiediagram.cpp
  41. +1 −1 src/core/diagram/qgspiediagram.h
  42. +5 −0 src/core/diagram/qgstextdiagram.cpp
  43. +1 −1 src/core/diagram/qgstextdiagram.h
  44. +3 −3 src/core/dxf/qgsdxfexport.cpp
  45. +1 −1 src/core/effects/qgsblureffect.cpp
  46. +2 −2 src/core/effects/qgscoloreffect.cpp
  47. +3 −3 src/core/expression/qgsexpression.cpp
  48. +11 −11 src/core/expression/qgsexpressionfunction.cpp
  49. +5 −5 src/core/expression/qgsexpressionnodeimpl.cpp
  50. +5 −5 src/core/fieldformatter/qgsrelationreferencefieldformatter.cpp
  51. +9 −9 src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
  52. +2 −2 src/core/geocms/geonode/qgsgeonodeconnection.cpp
  53. +2 −0 src/core/geometry/qgsabstractgeometry.h
  54. +2 −0 src/core/geometry/qgscircularstring.h
  55. +1 −1 src/core/geometry/qgscompoundcurve.cpp
  56. +2 −0 src/core/geometry/qgscompoundcurve.h
  57. +3 −3 src/core/geometry/qgscurvepolygon.cpp
  58. +2 −0 src/core/geometry/qgscurvepolygon.h
  59. +2 −0 src/core/geometry/qgsgeometrycollection.h
  60. +17 −17 src/core/geometry/qgsgeometrymakevalid.cpp
  61. +6 −6 src/core/geometry/qgsgeometryutils.cpp
  62. +1 −1 src/core/geometry/qgsgeometryutils.h
  63. +2 −0 src/core/geometry/qgslinestring.h
  64. +2 −0 src/core/geometry/qgsmulticurve.h
  65. +2 −0 src/core/geometry/qgsmultilinestring.h
  66. +2 −0 src/core/geometry/qgsmultipoint.h
  67. +2 −0 src/core/geometry/qgsmultipolygon.h
  68. +2 −0 src/core/geometry/qgsmultisurface.h
  69. +5 −5 src/core/geometry/qgspoint.cpp
  70. +2 −0 src/core/geometry/qgspoint.h
  71. +1 −1 src/core/geometry/qgstriangle.cpp
  72. +4 −4 src/core/layertree/qgslayertreelayer.cpp
  73. +1 −1 src/core/layertree/qgslayertreemodel.cpp
  74. +2 −2 src/core/layertree/qgslayertreeutils.cpp
  75. +1 −1 src/core/layout/qgslayout.cpp
  76. +1 −1 src/core/layout/qgslayoutguidecollection.cpp
  77. +3 −3 src/core/layout/qgslayoutitem.cpp
  78. +1 −1 src/core/layout/qgslayoutitempage.cpp
  79. +1 −1 src/core/locator/qgslocatormodel.cpp
  80. +5 −5 src/core/metadata/qgslayermetadata.cpp
  81. +33 −33 src/core/metadata/qgslayermetadataformatter.cpp
  82. +6 −6 src/core/processing/models/qgsprocessingmodelalgorithm.cpp
  83. +2 −2 src/core/processing/models/qgsprocessingmodelchildalgorithm.cpp
  84. +2 −2 src/core/processing/qgsprocessingalgorithm.cpp
  85. +2 −0 src/core/processing/qgsprocessingalgorithm.h
  86. +7 −7 src/core/processing/qgsprocessingparameters.cpp
  87. +2 −0 src/core/processing/qgsprocessingparameters.h
  88. +1 −1 src/core/processing/qgsprocessingprovider.cpp
  89. +5 −5 src/core/processing/qgsprocessingutils.cpp
  90. +4 −4 src/core/qgsaction.cpp
  91. +2 −2 src/core/qgsactionmanager.cpp
  92. +2 −0 src/core/qgsapplication.h
  93. +1 −0 src/core/qgscolorramp.h
  94. +1 −1 src/core/qgscoordinatereferencesystem.cpp
  95. +31 −31 src/core/qgsdatadefinedsizelegend.cpp
  96. +3 −3 src/core/qgsdiagramrenderer.cpp
  97. +1 −1 src/core/qgseditformconfig.cpp
  98. +2 −0 src/core/qgsfontutils.h
  99. +1 −1 src/core/qgsmaplayermodel.cpp
  100. +2 −0 src/core/qgsmaprenderertask.h
  101. +2 −2 src/core/qgsproject.cpp
  102. +8 −8 src/core/qgsprojectfiletransform.cpp
  103. +2 −0 src/core/qgsprojectversion.h
  104. +15 −15 src/core/qgsproperty.cpp
  105. +6 −6 src/core/qgspropertytransformer.cpp
  106. +1 −1 src/core/qgsproviderregistry.cpp
  107. +1 −1 src/core/qgsrenderchecker.h
  108. +8 −8 src/core/qgssettings.cpp
  109. +4 −4 src/core/qgsstacktrace.cpp
  110. +5 −5 src/core/qgsuserprofile.cpp
  111. +6 −6 src/core/qgsuserprofilemanager.cpp
  112. +2 −0 src/core/qgsuserprofilemanager.h
  113. +9 −9 src/core/qgsvectorfilewriter.cpp
  114. +1 −0 src/core/qgsvectorfilewriter.h
  115. +59 −59 src/core/qgsvectorlayer.cpp
  116. +2 −0 src/core/qgsvectorlayer.h
  117. +2 −2 src/core/qgsvectorlayerexporter.cpp
  118. +13 −13 src/core/qgsvectorlayerlabeling.cpp
  119. +1 −1 src/core/qgsvectorlayerutils.cpp
  120. +2 −0 src/core/qgsvirtuallayerdefinition.h
  121. +2 −2 src/core/raster/qgspalettedrasterrenderer.cpp
  122. +3 −1 src/core/raster/qgsrasterchecker.h
  123. +3 −0 src/core/raster/qgsrasterdataprovider.h
  124. +25 −25 src/core/raster/qgsrasterlayer.cpp
  125. +2 −0 src/core/raster/qgsrasterlayer.h
  126. +1 −1 src/core/raster/qgsrasterrenderer.h
  127. +2 −2 src/core/raster/qgsrastershader.cpp
  128. +2 −0 src/core/symbology/qgscolorbrewerpalette.h
  129. +2 −0 src/core/symbology/qgscptcityarchive.h
  130. +1 −1 src/core/symbology/qgsellipsesymbollayer.cpp
  131. +2 −0 src/core/symbology/qgsellipsesymbollayer.h
  132. +1 −1 src/core/symbology/qgsheatmaprenderer.cpp
  133. +1 −0 src/core/symbology/qgsmarkersymbollayer.h
  134. +2 −2 src/core/symbology/qgspointdisplacementrenderer.cpp
  135. +2 −2 src/core/symbology/qgsrenderer.cpp
  136. +4 −4 src/core/symbology/qgsrulebasedrenderer.cpp
  137. +4 −4 src/core/symbology/qgssinglesymbolrenderer.cpp
  138. +10 −10 src/core/symbology/qgsstyle.cpp
  139. +2 −2 src/core/symbology/qgssymbollayer.cpp
  140. +4 −4 src/core/symbology/qgssymbollayerutils.cpp
  141. +2 −0 src/gui/auth/qgsauthguiutils.h
  142. +4 −4 src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp
  143. +1 −1 src/gui/editorwidgets/qgsdatetimeedit.h
  144. +2 −2 src/gui/editorwidgets/qgsexternalresourcewidgetwrapper.cpp
  145. +1 −1 src/gui/layertree/qgslayertreeview.cpp
  146. +1 −1 src/gui/layout/qgslayoutruler.cpp
  147. +1 −1 src/gui/layout/qgslayoutview.cpp
  148. +2 −2 src/gui/locator/qgslocatorwidget.cpp
  149. +3 −1 src/gui/qgsbusyindicatordialog.h
  150. +1 −1 src/gui/qgscheckablecombobox.cpp
  151. +3 −1 src/gui/qgscodeeditor.h
  152. +1 −1 src/gui/qgscolorbutton.h
  153. +1 −1 src/gui/qgscolorrampbutton.cpp
  154. +2 −0 src/gui/qgsexpressionbuilderdialog.h
  155. +4 −2 src/gui/qgsexpressionbuilderwidget.h
  156. +2 −0 src/gui/qgsfieldvalidator.h
  157. +2 −2 src/gui/qgsfiledownloader.cpp
  158. +3 −3 src/gui/qgsfilewidget.cpp
  159. +5 −5 src/gui/qgshelp.cpp
  160. +3 −1 src/gui/qgsmanageconnectionsdialog.h
  161. +1 −1 src/gui/qgsmapcanvas.h
  162. +1 −1 src/gui/qgsmessagebar.cpp
  163. +4 −4 src/gui/qgsmessagelogviewer.cpp
  164. +5 −5 src/gui/qgsmetadatawidget.cpp
  165. +1 −1 src/gui/qgsnewgeopackagelayerdialog.cpp
  166. +2 −0 src/gui/qgsnewhttpconnection.h
  167. +5 −5 src/gui/qgsoptionsdialogbase.cpp
  168. +4 −4 src/gui/qgspasswordlineedit.cpp
  169. +1 −1 src/gui/qgsprojectionselectiontreewidget.cpp
  170. +4 −4 src/gui/qgspropertyoverridebutton.cpp
  171. +2 −0 src/gui/qgsrasterformatsaveoptionswidget.h
  172. +2 −0 src/gui/qgsrasterpyramidsoptionswidget.h
  173. +1 −1 src/gui/qgsratiolockbutton.cpp
  174. +1 −1 src/gui/qgsshortcutsmanager.cpp
  175. +2 −0 src/gui/qgsshortcutsmanager.h
  176. +6 −6 src/gui/qgstaskmanagerwidget.cpp
  177. +2 −2 src/gui/raster/qgsrendererrasterpropertieswidget.cpp
  178. +1 −1 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
  179. +2 −2 src/gui/symbology/qgsdatadefinedsizelegendwidget.cpp
  180. +2 −2 src/gui/symbology/qgsstyleexportimportdialog.cpp
  181. +2 −2 src/gui/symbology/qgsstylemanagerdialog.cpp
  182. +2 −2 src/gui/symbology/qgssymbolslistwidget.cpp
  183. +1 −1 src/plugins/geometry_checker/checks/qgsgeometryselfcontactcheck.h
  184. +2 −2 src/providers/gdal/qgsgdaldataitems.cpp
  185. +3 −3 src/providers/gdal/qgsgdalprovider.cpp
  186. +1 −1 src/providers/geonode/qgsgeonodenewconnection.cpp
  187. +3 −3 src/providers/geonode/qgsgeonodesourceselect.cpp
  188. +2 −0 src/providers/grass/qgsgrass.h
  189. +4 −4 src/providers/mssql/qgsmssqlprovider.cpp
  190. +3 −3 src/providers/ogr/qgsogrdataitems.cpp
  191. +14 −14 src/providers/ogr/qgsogrprovider.cpp
  192. +3 −1 src/providers/ogr/qgsogrprovider.h
  193. +3 −3 src/providers/postgres/qgspostgresconn.cpp
  194. +1 −0 src/providers/postgres/qgspostgresconn.h
  195. +6 −6 src/providers/postgres/qgspostgresexpressioncompiler.cpp
  196. +9 −9 src/providers/postgres/qgspostgresprovider.cpp
  197. +3 −1 src/providers/postgres/qgspostgresprovider.h
  198. +3 −3 src/providers/spatialite/qgsspatialiteprovider.cpp
  199. +3 −1 src/providers/spatialite/qgsspatialiteprovider.h
  200. +5 −3 src/providers/virtual/qgsvirtuallayerprovider.h
  201. +2 −2 src/providers/wfs/qgswfscapabilities.cpp
  202. +5 −5 src/providers/wfs/qgswfsdataitems.cpp
  203. +7 −7 src/providers/wfs/qgswfsfeatureiterator.cpp
  204. +8 −8 src/providers/wfs/qgswfsprovider.cpp
  205. +2 −2 src/providers/wfs/qgswfsshareddata.cpp
  206. +2 −2 src/providers/wms/qgswmsdataitems.cpp
  207. +5 −5 src/python/qgspythonutilsimpl.cpp
  208. +1 −1 tests/src/app/testqgsattributetable.cpp
  209. +5 −5 tests/src/app/testqgsnodetool.cpp
  210. +1 −1 tests/src/core/testqgscomposergroup.cpp
  211. +1 −1 tests/src/core/testqgscomposermap.cpp
  212. +4 −4 tests/src/core/testqgscomposerscalebar.cpp
  213. +39 −39 tests/src/core/testqgscomposition.cpp
  214. +2 −2 tests/src/core/testqgscoordinatereferencesystem.cpp
  215. +2 −2 tests/src/core/testqgscurve.cpp
  216. +18 −18 tests/src/core/testqgsdatadefinedsizelegend.cpp
  217. +25 −25 tests/src/core/testqgsdiagram.cpp
  218. +5 −5 tests/src/core/testqgsexpression.cpp
  219. +4 −4 tests/src/core/testqgsexpressioncontext.cpp
  220. +1 −1 tests/src/core/testqgsfield.cpp
  221. +1 −1 tests/src/core/testqgsfields.cpp
  222. +38 −38 tests/src/core/testqgsgeometry.cpp
  223. +12 −12 tests/src/core/testqgsgeometryimport.cpp
  224. +1 −1 tests/src/core/testqgsgeonodeconnection.cpp
  225. +7 −7 tests/src/core/testqgslabelingengine.cpp
  226. +7 −7 tests/src/core/testqgslayertree.cpp
  227. +7 −7 tests/src/core/testqgslayout.cpp
  228. +2 −2 tests/src/core/testqgslayoutcontext.cpp
  229. +14 −14 tests/src/core/testqgslayoutitem.cpp
  230. +8 −8 tests/src/core/testqgslayoutobject.cpp
  231. +1 −1 tests/src/core/testqgslayoutpage.cpp
  232. +3 −3 tests/src/core/testqgslayoutunits.cpp
  233. +3 −3 tests/src/core/testqgslayoututils.cpp
  234. +10 −10 tests/src/core/testqgslegendrenderer.cpp
  235. +4 −4 tests/src/core/testqgsmaplayer.cpp
  236. +10 −10 tests/src/core/testqgsmapsettings.cpp
  237. +10 −10 tests/src/core/testqgspagesizeregistry.cpp
  238. +2 −2 tests/src/core/testqgspointlocator.cpp
  239. +1 −1 tests/src/core/testqgspointpatternfillsymbol.cpp
  240. +18 −18 tests/src/core/testqgsproject.cpp
  241. +48 −48 tests/src/core/testqgsproperty.cpp
  242. +3 −3 tests/src/core/testqgsrasterblock.cpp
  243. +6 −6 tests/src/core/testqgsrasterfilewriter.cpp
  244. +4 −4 tests/src/core/testqgsstyle.cpp
  245. +12 −12 tests/src/core/testqgstaskmanager.cpp
  246. +1 −1 tests/src/core/testqgsvectorlayer.cpp
  247. +40 −40 tests/src/gui/testqgsattributeform.cpp
  248. +2 −2 tests/src/gui/testqgsdualview.cpp
  249. +1 −1 tests/src/gui/testqgseditorwidgetregistry.cpp
  250. +7 −7 tests/src/gui/testqgsfiledownloader.cpp
  251. +1 −1 tests/src/gui/testqgslayoutview.cpp
  252. +1 −1 tests/src/gui/testqgsmaptooledit.cpp
  253. +12 −12 tests/src/gui/testqgsrelationreferencewidget.cpp
  254. +1 −1 tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp
@@ -60,4 +60,6 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
QgsGraph *mGraph = nullptr;
};

// clazy:excludeall=qstring-allocations

#endif // QGSGRAPHBUILDER_H
@@ -134,4 +134,6 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface

};

// clazy:excludeall=qstring-allocations

#endif // QGSGRAPHBUILDERINTERFACE_H
@@ -26,7 +26,7 @@
QString QgsOSMDownload::defaultServiceUrl()
{
QgsSettings settings;
return settings.value( "overpass_url", "http://overpass-api.de/api/interpreter" ).toString();
return settings.value( QStringLiteral( "overpass_url" ), "http://overpass-api.de/api/interpreter" ).toString();
}


@@ -64,7 +64,7 @@ class ANALYSIS_EXPORT QgsZonalStatistics
*/
QgsZonalStatistics( QgsVectorLayer *polygonLayer,
QgsRasterLayer *rasterLayer,
const QString &attributePrefix = "",
const QString &attributePrefix = QString(),
int rasterBand = 1,
QgsZonalStatistics::Statistics stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean ) );

@@ -147,4 +147,6 @@ class ANALYSIS_EXPORT QgsZonalStatistics

Q_DECLARE_OPERATORS_FOR_FLAGS( QgsZonalStatistics::Statistics )

// clazy:excludeall=qstring-allocations

#endif // QGSZONALSTATISTICS_H
@@ -2315,7 +2315,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
bool QgsComposer::saveImage( const QImage &img, const QString &imageFilename, const QString &imageFormat )
{
QImageWriter w( imageFilename, imageFormat.toLocal8Bit().constData() );
if ( imageFormat.compare( "tiff", Qt::CaseInsensitive ) == 0 || imageFormat.compare( "tif", Qt::CaseInsensitive ) == 0 )
if ( imageFormat.compare( QLatin1String( "tiff" ), Qt::CaseInsensitive ) == 0 || imageFormat.compare( QLatin1String( "tif" ), Qt::CaseInsensitive ) == 0 )
{
w.setCompression( 1 ); //use LZW compression
}
@@ -299,7 +299,7 @@ bool DRW_Entity::parseDwg( DRW::Version version, dwgBuffer *buf, dwgBuffer *strB
for ( int i = 0; i < strLength + 1; i++ ) //string length + null terminating char
{
duint8 dxfChar = tmpExtDataBuf.getRawChar8();
l << QString( "0x%1" ).arg( dxfChar, 0, 16 );
l << QStringLiteral( "0x%1" ).arg( dxfChar, 0, 16 );
}

QgsDebugMsg( QString( "strLength:%1; str codepage:%2; %3" ).arg( strLength ).arg( cp ).arg( l.join( " " ) ) );
@@ -2708,7 +2708,7 @@ bool DRW_Header::parseDwg( DRW::Version version, dwgBuffer *buf, dwgBuffer *hBbu
for ( int i = 0; i < 16; i++ )
{
t = buf->getRawChar8();
l << QString( "0x%1" ).arg( t, 0, 16 );
l << QStringLiteral( "0x%1" ).arg( t, 0, 16 );
}
QgsDebugMsg( QString( "dwg header end sentinel=%1" ).arg( l.join( " " ) ) );

@@ -2753,7 +2753,7 @@ bool DRW_Header::parseDwg( DRW::Version version, dwgBuffer *buf, dwgBuffer *hBbu
for ( int i = 0; i < 16; i++ )
{
t = buf->getRawChar8();
l << QString( "0x%1" ).arg( t, 0, 16 );
l << QStringLiteral( "0x%1" ).arg( t, 0, 16 );
}
QgsDebugMsg( QString( "dwg header end sentinel=%1" ).arg( l.join( " " ) ) );

@@ -571,7 +571,7 @@ bool DRW_LType::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
QStringList l;
for ( unsigned i = 0; i < path.size() ; i++ )
{
l << QString( "%1" ).arg( path[i] );
l << QStringLiteral( "%1" ).arg( path[i] );
}
QgsDebugMsg( QString( "path=%1 rem:%2" ).arg( l.join( " " ) ).arg( buf->numRemainingBytes() ) );

@@ -178,30 +178,30 @@ void print_debug::printUI( long long unsigned int i )

void print_debug::printD( double d )
{
mTS << QString( "%1 " ).arg( d, 0, 'g' );
mTS << QStringLiteral( "%1 " ).arg( d, 0, 'g' );
flush();
}

void print_debug::printH( long long i )
{
mTS << QString( "0x%1" ).arg( i, 0, 16 );
mTS << QStringLiteral( "0x%1" ).arg( i, 0, 16 );
flush();
}

void print_debug::printB( int i )
{
mTS << QString( "0%1" ).arg( i, 0, 8 );
mTS << QStringLiteral( "0%1" ).arg( i, 0, 8 );
flush();
}

void print_debug::printHL( int c, int s, int h )
{
mTS << QString( "%1.%2 0x%3" ).arg( c ).arg( s ).arg( h, 0, 16 );
mTS << QStringLiteral( "%1.%2 0x%3" ).arg( c ).arg( s ).arg( h, 0, 16 );
flush();
}

void print_debug::printPT( double x, double y, double z )
{
mTS << QString( "x:%1 y:%2 z:%3" ).arg( x, 0, 'g' ).arg( y, 0, 'g' ).arg( z, 0, 'g' );
mTS << QStringLiteral( "x:%1 y:%2 z:%3" ).arg( x, 0, 'g' ).arg( y, 0, 'g' ).arg( z, 0, 'g' );
flush();
}
@@ -141,7 +141,7 @@ bool dwgReader::checkSentinel( dwgBuffer *buf, enum secEnum::DWGSection, bool st
for ( int i = 0; i < 16; i++ )
{
int t = buf->getRawChar8();
l << QString( "0x%1" ).arg( t, 0, 16 );
l << QStringLiteral( "0x%1" ).arg( t, 0, 16 );
}
QgsDebugMsg( l.join( " " ) );
return true;
@@ -67,16 +67,16 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDwgImportDialog::showHelp );

QgsSettings s;
leDatabase->setText( s.value( "/DwgImport/lastDatabase", "" ).toString() );
cbExpandInserts->setChecked( s.value( "/DwgImport/lastExpandInserts", true ).toBool() );
cbMergeLayers->setChecked( s.value( "/DwgImport/lastMergeLayers", false ).toBool() );
cbUseCurves->setChecked( s.value( "/DwgImport/lastUseCurves", true ).toBool() );
leDatabase->setText( s.value( QStringLiteral( "/DwgImport/lastDatabase" ), "" ).toString() );
cbExpandInserts->setChecked( s.value( QStringLiteral( "/DwgImport/lastExpandInserts" ), true ).toBool() );
cbMergeLayers->setChecked( s.value( QStringLiteral( "/DwgImport/lastMergeLayers" ), false ).toBool() );
cbUseCurves->setChecked( s.value( QStringLiteral( "/DwgImport/lastUseCurves" ), true ).toBool() );

leDrawing->setReadOnly( true );
pbImportDrawing->setHidden( true );
lblMessage->setHidden( true );

int crsid = s.value( "/DwgImport/lastCrs", QString::number( QgsProject::instance()->crs().srsid() ) ).toInt();
int crsid = s.value( QStringLiteral( "/DwgImport/lastCrs" ), QString::number( QgsProject::instance()->crs().srsid() ) ).toInt();

QgsCoordinateReferenceSystem crs( crsid, QgsCoordinateReferenceSystem::InternalCrsId );
mCrsSelector->setCrs( crs );
@@ -87,17 +87,17 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
on_pbLoadDatabase_clicked();
updateUI();

restoreGeometry( s.value( "/Windows/DwgImport/geometry" ).toByteArray() );
restoreGeometry( s.value( QStringLiteral( "/Windows/DwgImport/geometry" ) ).toByteArray() );
}

QgsDwgImportDialog::~QgsDwgImportDialog()
{
QgsSettings s;
s.setValue( "/DwgImport/lastDatabase", leDatabase->text() );
s.setValue( "/DwgImport/lastExpandInserts", cbExpandInserts->isChecked() );
s.setValue( "/DwgImport/lastMergeLayers", cbMergeLayers->isChecked() );
s.setValue( "/DwgImport/lastUseCurves", cbUseCurves->isChecked() );
s.setValue( "/Windows/DwgImport/geometry", saveGeometry() );
s.setValue( QStringLiteral( "/DwgImport/lastDatabase" ), leDatabase->text() );
s.setValue( QStringLiteral( "/DwgImport/lastExpandInserts" ), cbExpandInserts->isChecked() );
s.setValue( QStringLiteral( "/DwgImport/lastMergeLayers" ), cbMergeLayers->isChecked() );
s.setValue( QStringLiteral( "/DwgImport/lastUseCurves" ), cbUseCurves->isChecked() );
s.setValue( QStringLiteral( "/Windows/DwgImport/geometry" ), saveGeometry() );
}

void QgsDwgImportDialog::updateUI()
@@ -158,12 +158,12 @@ void QgsDwgImportDialog::on_pbLoadDatabase_clicked()

bool lblVisible = false;

std::unique_ptr<QgsVectorLayer> d( new QgsVectorLayer( QString( "%1|layername=drawing" ).arg( leDatabase->text() ), "layers", "ogr", false ) );
std::unique_ptr<QgsVectorLayer> d( new QgsVectorLayer( QStringLiteral( "%1|layername=drawing" ).arg( leDatabase->text() ), QStringLiteral( "layers" ), QStringLiteral( "ogr" ), false ) );
if ( d && d->isValid() )
{
int idxPath = d->fields().lookupField( "path" );
int idxLastModified = d->fields().lookupField( "lastmodified" );
int idxCrs = d->fields().lookupField( "crs" );
int idxPath = d->fields().lookupField( QStringLiteral( "path" ) );
int idxLastModified = d->fields().lookupField( QStringLiteral( "lastmodified" ) );
int idxCrs = d->fields().lookupField( QStringLiteral( "crs" ) );

QgsFeature f;
if ( d->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( QgsAttributeList() << idxPath << idxLastModified << idxCrs ) ).nextFeature( f ) )
@@ -193,12 +193,12 @@ void QgsDwgImportDialog::on_pbLoadDatabase_clicked()

lblMessage->setVisible( lblVisible );

std::unique_ptr<QgsVectorLayer> l( new QgsVectorLayer( QString( "%1|layername=layers" ).arg( leDatabase->text() ), "layers", "ogr", false ) );
std::unique_ptr<QgsVectorLayer> l( new QgsVectorLayer( QStringLiteral( "%1|layername=layers" ).arg( leDatabase->text() ), QStringLiteral( "layers" ), QStringLiteral( "ogr" ), false ) );
if ( l && l->isValid() )
{
int idxName = l->fields().lookupField( "name" );
int idxColor = l->fields().lookupField( "ocolor" );
int idxFlags = l->fields().lookupField( "flags" );
int idxName = l->fields().lookupField( QStringLiteral( "name" ) );
int idxColor = l->fields().lookupField( QStringLiteral( "ocolor" ) );
int idxFlags = l->fields().lookupField( QStringLiteral( "flags" ) );

QgsDebugMsg( QString( "idxName:%1 idxColor:%2 idxFlags:%3" ).arg( idxName ).arg( idxColor ).arg( idxFlags ) );

@@ -269,8 +269,8 @@ void QgsDwgImportDialog::on_pbImportDrawing_clicked()

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

if ( l->featureCount() == 0 )
{
@@ -295,32 +295,32 @@ void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &n
QStringList exprlist;
Q_FOREACH ( QString layer, layers )
{
exprlist.append( QString( "'%1'" ).arg( layer.replace( "'", "''" ) ) );
exprlist.append( QStringLiteral( "'%1'" ).arg( layer.replace( QLatin1String( "'" ), QLatin1String( "''" ) ) ) );
}
layerFilter = QString( "layer IN (%1) AND " ).arg( exprlist.join( "," ) );
layerFilter = QStringLiteral( "layer IN (%1) AND " ).arg( exprlist.join( QStringLiteral( "," ) ) );
}

QgsVectorLayer *l = nullptr;
QgsSymbol *sym = nullptr;

l = layer( layerGroup, layerFilter, "hatches" );
l = layer( layerGroup, layerFilter, QStringLiteral( "hatches" ) );
if ( l )
{
QgsSimpleFillSymbolLayer *sfl = new QgsSimpleFillSymbolLayer();
sfl->setDataDefinedProperty( QgsSymbolLayer::PropertyFillColor, QgsProperty::fromField( "color" ) );
sfl->setDataDefinedProperty( QgsSymbolLayer::PropertyFillColor, QgsProperty::fromField( QStringLiteral( "color" ) ) );
sfl->setStrokeStyle( Qt::NoPen );
sym = new QgsFillSymbol();
sym->changeSymbolLayer( 0, sfl );
l->setRenderer( new QgsSingleSymbolRenderer( sym ) );
}

l = layer( layerGroup, layerFilter, "lines" );
l = layer( layerGroup, layerFilter, QStringLiteral( "lines" ) );
if ( l )
{
QgsSimpleLineSymbolLayer *sll = new QgsSimpleLineSymbolLayer();
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromField( "color" ) );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromField( QStringLiteral( "color" ) ) );
sll->setPenJoinStyle( Qt::MiterJoin );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeWidth, QgsProperty::fromField( "linewidth" ) );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeWidth, QgsProperty::fromField( QStringLiteral( "linewidth" ) ) );
// sll->setUseCustomDashPattern( true );
// sll->setCustomDashPatternUnit( QgsSymbolV2::MapUnit );
// sll->setDataDefinedProperty( QgsSymbolLayer::PropertyCustomDash, QgsProperty::fromField( "linetype" ) );
@@ -330,13 +330,13 @@ void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &n
l->setRenderer( new QgsSingleSymbolRenderer( sym ) );
}

l = layer( layerGroup, layerFilter, "polylines" );
l = layer( layerGroup, layerFilter, QStringLiteral( "polylines" ) );
if ( l )
{
QgsSimpleLineSymbolLayer *sll = new QgsSimpleLineSymbolLayer();
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromField( "color" ) );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromField( QStringLiteral( "color" ) ) );
sll->setPenJoinStyle( Qt::MiterJoin );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeWidth, QgsProperty::fromField( "width" ) );
sll->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeWidth, QgsProperty::fromField( QStringLiteral( "width" ) ) );
// sll->setUseCustomDashPattern( true );
// sll->setCustomDashPatternUnit( QgsSymbolV2::MapUnit );
// sll->setDataDefinedProperty( QgsSymbolLayer::PropertyCustomDash, QgsProperty::fromField( "linetype" ) );
@@ -346,7 +346,7 @@ void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &n
l->setRenderer( new QgsSingleSymbolRenderer( sym ) );
}

l = layer( layerGroup, layerFilter, "texts" );
l = layer( layerGroup, layerFilter, QStringLiteral( "texts" ) );
if ( l )
{
l->setRenderer( new QgsNullSymbolRenderer() );
@@ -358,8 +358,8 @@ void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &n
pls.setFormat( tf );

pls.drawLabels = true;
pls.fieldName = "text";
pls.wrapChar = "\\P";
pls.fieldName = QStringLiteral( "text" );
pls.wrapChar = QStringLiteral( "\\P" );

pls.dataDefinedProperties().setProperty( QgsPalLayerSettings::Size, QgsProperty::fromField( QStringLiteral( "height" ) ) );
pls.dataDefinedProperties().setProperty( QgsPalLayerSettings::Color, QgsProperty::fromField( QStringLiteral( "color" ) ) );
@@ -403,15 +403,15 @@ void QgsDwgImportDialog::createGroup( QgsLayerTreeGroup *group, const QString &n
l->setLabeling( new QgsVectorLayerSimpleLabeling( pls ) );
}

l = layer( layerGroup, layerFilter, "points" );
l = layer( layerGroup, layerFilter, QStringLiteral( "points" ) );
if ( l )
{
// FIXME: use PDMODE?
l->setRenderer( new QgsNullSymbolRenderer() );
}

if ( !cbExpandInserts->isChecked() )
layer( layerGroup, layerFilter, "inserts" );
layer( layerGroup, layerFilter, QStringLiteral( "inserts" ) );

if ( !layerGroup->children().isEmpty() )
{

0 comments on commit 31c1ae1

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