Skip to content
Permalink
Browse files

Use QString::arg multi argument method to avoid extra heap allocations

  • Loading branch information
nyalldawson committed Oct 15, 2015
1 parent f50e1a7 commit 5ed3d1b73fbdab7340f4c3d78c6ef3df85feec82
Showing with 1,182 additions and 1,172 deletions.
  1. +1 −1 python/core/qgsfield.sip
  2. +3 −3 src/analysis/openstreetmap/qgsosmdatabase.cpp
  3. +2 −2 src/analysis/openstreetmap/qgsosmimport.cpp
  4. +3 −3 src/analysis/raster/qgsalignraster.cpp
  5. +4 −4 src/app/composer/qgsatlascompositionwidget.cpp
  6. +5 −5 src/app/gps/qgsgpsinformationwidget.cpp
  7. +2 −2 src/app/main.cpp
  8. +6 −6 src/app/ogr/qgsvectorlayersaveasdialog.cpp
  9. +1 −1 src/app/openstreetmap/qgsosmexportdialog.cpp
  10. +17 −17 src/app/pluginmanager/qgspluginmanager.cpp
  11. +33 −33 src/app/qgisapp.cpp
  12. +3 −3 src/app/qgisappstylesheet.cpp
  13. +1 −1 src/app/qgsapplayertreeviewmenuprovider.cpp
  14. +1 −1 src/app/qgsattributetabledialog.cpp
  15. +1 −1 src/app/qgsattributetypedialog.cpp
  16. +7 −7 src/app/qgsbookmarks.cpp
  17. +3 −3 src/app/qgsbrowserdockwidget.cpp
  18. +4 −4 src/app/qgsconfigureshortcutsdialog.cpp
  19. +1 −1 src/app/qgscustomization.cpp
  20. +9 −9 src/app/qgscustomprojectiondialog.cpp
  21. +1 −1 src/app/qgsdecorationitem.cpp
  22. +1 −1 src/app/qgsfieldsproperties.cpp
  23. +4 −4 src/app/qgshandlebadlayers.cpp
  24. +4 −4 src/app/qgsidentifyresultsdialog.cpp
  25. +1 −1 src/app/qgsmeasuredialog.cpp
  26. +9 −9 src/app/qgsnewspatialitelayerdialog.cpp
  27. +1 −1 src/app/qgsoptions.cpp
  28. +7 −7 src/app/qgspluginregistry.cpp
  29. +6 −3 src/app/qgsrasterlayerproperties.cpp
  30. +2 −2 src/app/qgswelcomepage.cpp
  31. +9 −3 src/app/qgswelcomepageitemsmodel.cpp
  32. +1 −1 src/auth/basic/qgsauthbasicmethod.cpp
  33. +1 −1 src/auth/identcert/qgsauthidentcertedit.cpp
  34. +1 −1 src/auth/pkipaths/qgsauthpkipathsedit.cpp
  35. +1 −1 src/auth/pkipkcs12/qgsauthpkcs12edit.cpp
  36. +2 −2 src/browser/main.cpp
  37. +1 −1 src/core/auth/qgsauthconfig.cpp
  38. +22 −22 src/core/auth/qgsauthmanager.cpp
  39. +2 −2 src/core/auth/qgsauthmethodregistry.cpp
  40. +2 −2 src/core/dxf/qgsdxfexport.cpp
  41. +1 −1 src/core/geometry/qgscompoundcurvev2.cpp
  42. +1 −1 src/core/geometry/qgscurvepolygonv2.cpp
  43. +1 −1 src/core/geometry/qgsgeometrycollectionv2.cpp
  44. +9 −9 src/core/qgsapplication.cpp
  45. +1 −1 src/core/qgsconditionalstyle.cpp
  46. +24 −24 src/core/qgscoordinatereferencesystem.cpp
  47. +4 −4 src/core/qgscoordinatetransform.cpp
  48. +3 −3 src/core/qgscredentials.cpp
  49. +4 −4 src/core/qgsdartmeasurement.cpp
  50. +8 −8 src/core/qgsdataitem.cpp
  51. +5 −5 src/core/qgsdatasourceuri.cpp
  52. +4 −4 src/core/qgsdistancearea.cpp
  53. +2 −2 src/core/qgserror.cpp
  54. +17 −17 src/core/qgsexpression.cpp
  55. +3 −3 src/core/qgsfontutils.cpp
  56. +1 −1 src/core/qgsgml.cpp
  57. +3 −3 src/core/qgsgmlschema.cpp
  58. +2 −2 src/core/qgslegacyhelpers.cpp
  59. +5 −5 src/core/qgsmaplayer.cpp
  60. +5 −5 src/core/qgsmaprenderer.cpp
  61. +5 −5 src/core/qgsmapsettings.cpp
  62. +1 −1 src/core/qgsmessagelog.cpp
  63. +3 −3 src/core/qgsmimedatautils.cpp
  64. +6 −6 src/core/qgsnetworkaccessmanager.cpp
  65. +2 −2 src/core/qgsnetworkcontentfetcher.cpp
  66. +4 −4 src/core/qgsofflineediting.cpp
  67. +1 −1 src/core/qgsogcutils.cpp
  68. +1 −1 src/core/qgspallabeling.cpp
  69. +2 −2 src/core/qgspoint.cpp
  70. +1 −1 src/core/qgsproject.cpp
  71. +8 −8 src/core/qgsprojectproperty.cpp
  72. +2 −2 src/core/qgsproviderregistry.cpp
  73. +12 −12 src/core/qgsrenderchecker.cpp
  74. +2 −2 src/core/qgsrenderchecker.h
  75. +2 −2 src/core/qgsscaleutils.cpp
  76. +2 −2 src/core/qgsvectordataprovider.cpp
  77. +9 −9 src/core/qgsvectorfilewriter.cpp
  78. +4 −4 src/core/qgsvectorlayer.cpp
  79. +8 −8 src/core/qgsvectorlayereditbuffer.cpp
  80. +1 −1 src/core/qgsvectorlayerimport.cpp
  81. +2 −2 src/core/qgsvectorlayerlabelprovider.cpp
  82. +8 −8 src/core/raster/qgsrasterchecker.cpp
  83. +1 −1 src/core/raster/qgsrasterlayer.cpp
  84. +1 −1 src/core/raster/qgsrasterpipe.cpp
  85. +3 −3 src/core/raster/qgsrasterrenderer.cpp
  86. +4 −4 src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
  87. +2 −2 src/core/symbology-ng/qgscptcityarchive.cpp
  88. +1 −1 src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
  89. +1 −1 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
  90. +6 −7 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
  91. +1 −1 src/core/symbology-ng/qgssvgcache.cpp
  92. +2 −2 src/core/symbology-ng/qgssymbollayerv2utils.cpp
  93. +1 −2 src/gui/attributetable/qgsdualview.cpp
  94. +3 −3 src/gui/auth/qgsauthcertificateinfo.cpp
  95. +2 −2 src/gui/auth/qgsauthcerttrustpolicycombobox.cpp
  96. +2 −2 src/gui/auth/qgsauthconfigedit.cpp
  97. +3 −3 src/gui/auth/qgsauthguiutils.cpp
  98. +2 −2 src/gui/auth/qgsauthimportidentitydialog.cpp
  99. +2 −2 src/gui/auth/qgsauthserverseditor.cpp
  100. +5 −5 src/gui/auth/qgsauthsslerrorsdialog.cpp
  101. +5 −5 src/gui/auth/qgsauthsslimportdialog.cpp
  102. +3 −3 src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp
  103. +1 −1 src/gui/editorwidgets/qgsrangeconfigdlg.cpp
  104. +3 −3 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
  105. +1 −1 src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
  106. +1 −1 src/gui/qgisgui.cpp
  107. +2 −2 src/gui/qgsattributeform.cpp
  108. +4 −4 src/gui/qgsattributeformlegacyinterface.cpp
  109. +1 −1 src/gui/qgscharacterselectdialog.cpp
  110. +1 −1 src/gui/qgscollapsiblegroupbox.cpp
  111. +4 −4 src/gui/qgscolorbutton.cpp
  112. +1 −1 src/gui/qgscredentialdialog.cpp
  113. +1 −1 src/gui/qgsdatadefinedbutton.cpp
  114. +4 −4 src/gui/qgsdatumtransformdialog.cpp
  115. +2 −2 src/gui/qgsexpressionbuilderwidget.cpp
  116. +1 −1 src/gui/qgsextentgroupbox.cpp
  117. +1 −1 src/gui/qgsgenericprojectionselector.cpp
  118. +2 −2 src/gui/qgsidentifymenu.cpp
  119. +6 −6 src/gui/qgsmanageconnectionsdialog.cpp
  120. +1 −1 src/gui/qgsnewmemorylayerdialog.cpp
  121. +1 −1 src/gui/qgsnewnamedialog.cpp
  122. +2 −2 src/gui/qgsnewvectorlayerdialog.cpp
  123. +1 −1 src/gui/qgsoptionsdialogbase.cpp
  124. +2 −2 src/gui/qgsprojectbadlayerguihandler.cpp
  125. +6 −6 src/gui/qgsprojectionselectionwidget.cpp
  126. +5 −5 src/gui/qgsprojectionselector.cpp
  127. +2 −2 src/gui/qgsrasterformatsaveoptionswidget.cpp
  128. +1 −1 src/gui/qgsrasterlayersaveasdialog.cpp
  129. +4 −4 src/gui/qgsrelationmanagerdialog.cpp
  130. +2 −2 src/gui/raster/qgsrasterhistogramwidget.cpp
  131. +1 −1 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
  132. +6 −6 src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
  133. +1 −1 src/helpviewer/main.cpp
  134. +2 −2 src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp
  135. +2 −2 src/plugins/georeferencer/qgsgcpcanvasitem.cpp
  136. +4 −4 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  137. +3 −3 src/plugins/grass/qgsgrassmoduleoptions.cpp
  138. +2 −2 src/plugins/grass/qgsgrasstools.cpp
  139. +5 −5 src/plugins/oracle_raster/qgsselectgeoraster_ui.cpp
  140. +7 −7 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  141. +21 −21 src/plugins/spit/qgsshapefile.cpp
  142. +22 −22 src/plugins/spit/qgsspit.cpp
  143. +7 −7 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  144. +1 −1 src/providers/gdal/qgsgdaldataitems.cpp
  145. +7 −7 src/providers/gdal/qgsgdalprovider.cpp
  146. +1 −1 src/providers/grass/qgis.v.in.cpp
  147. +24 −24 src/providers/grass/qgsgrass.cpp
  148. +4 −4 src/providers/grass/qgsgrassimport.cpp
  149. +1 −1 src/providers/grass/qgsgrassprovider.cpp
  150. +6 −5 src/providers/grass/qgsgrassprovidermodule.cpp
  151. +14 −14 src/providers/grass/qgsgrassrasterprovider.cpp
  152. +1 −1 src/providers/grass/qgsgrassvector.cpp
  153. +21 −21 src/providers/grass/qgsgrassvectormaplayer.cpp
  154. +2 −2 src/providers/mssql/qgsmssqldataitems.cpp
  155. +17 −19 src/providers/mssql/qgsmssqlprovider.cpp
  156. +6 −6 src/providers/mssql/qgsmssqlsourceselect.cpp
  157. +7 −7 src/providers/mssql/qgsmssqltablemodel.cpp
  158. +9 −9 src/providers/ogr/qgsogrprovider.cpp
  159. +4 −4 src/providers/postgres/qgscolumntypethread.cpp
  160. +23 −23 src/providers/postgres/qgspostgresconn.cpp
  161. +7 −7 src/providers/postgres/qgspostgresconn.h
  162. +18 −18 src/providers/postgres/qgspostgresdataitems.cpp
  163. +1 −1 src/providers/postgres/qgspostgresexpressioncompiler.cpp
  164. +28 −28 src/providers/postgres/qgspostgresfeatureiterator.cpp
  165. +149 −149 src/providers/postgres/qgspostgresprovider.cpp
  166. +4 −4 src/providers/spatialite/qgsspatialiteconnection.cpp
  167. +2 −2 src/providers/spatialite/qgsspatialitedataitems.cpp
  168. +16 −16 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
  169. +73 −73 src/providers/spatialite/qgsspatialiteprovider.cpp
  170. +3 −3 src/providers/spatialite/qgsspatialitesourceselect.cpp
  171. +10 −10 src/providers/wcs/qgswcscapabilities.cpp
  172. +21 −21 src/providers/wcs/qgswcsprovider.cpp
  173. +1 −1 src/providers/wcs/qgswcsprovider.h
  174. +5 −5 src/providers/wfs/qgswfscapabilities.cpp
  175. +7 −7 src/providers/wfs/qgswfsprovider.cpp
  176. +1 −1 src/providers/wfs/qgswfsprovider.h
  177. +14 −14 src/providers/wms/qgswmscapabilities.cpp
  178. +1 −1 src/providers/wms/qgswmscapabilities.h
  179. +75 −71 src/providers/wms/qgswmsprovider.cpp
  180. +2 −2 src/providers/wms/qgswmssourceselect.cpp
  181. +1 −1 src/python/qgspythonutilsimpl.cpp
  182. +1 −1 tests/src/analysis/testqgsalignraster.cpp
  183. +3 −3 tests/src/core/testqgscomposermap.cpp
  184. +3 −3 tests/src/core/testqgscoordinatereferencesystem.cpp
  185. +3 −3 tests/src/core/testqgsdataitem.cpp
  186. +2 −2 tests/src/core/testqgsrasterlayer.cpp
  187. +1 −1 tests/src/core/testqgsstylev2.cpp
  188. +4 −4 tests/src/core/testziplayer.cpp
  189. +3 −3 tests/src/providers/grass/testqgsgrassprovider.cpp
  190. +1 −1 tests/src/providers/testqgswcsprovider.cpp
  191. +4 −4 tests/src/providers/testqgswcspublicservers.cpp
@@ -155,7 +155,7 @@ class QgsField
if ( !sipRes )
{
PyErr_SetString(PyExc_ValueError,
QString( "Value %1 (%2) could not be converted to field type %3." ).arg( a0->toString() ).arg ( a0->typeName() ).arg( sipCpp->type() ).toUtf8().constData() );
QString( "Value %1 (%2) could not be converted to field type %3." ).arg( a0->toString(), a0->typeName() ).arg( sipCpp->type() ).toUtf8().constData() );
sipError = sipErrorFail;
}

@@ -282,7 +282,7 @@ bool QgsOSMDatabase::prepareStatements()
{
const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free
mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" )
.arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sql[i] ) );
.arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sql[i] ) );
return false;
}
}
@@ -348,8 +348,8 @@ bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString
}

QString sqlAddGeomColumn = QString( "SELECT AddGeometryColumn(%1, 'geometry', 4326, %2, 'XY')" )
.arg( quotedValue( tableName ) )
.arg( quotedValue( geometryType ) );
.arg( quotedValue( tableName ),
quotedValue( geometryType ) );
ret = sqlite3_exec( mDatabase, sqlAddGeomColumn.toUtf8().constData(), NULL, NULL, &errMsg );
if ( ret != SQLITE_OK )
{
@@ -169,7 +169,7 @@ bool QgsOSMXmlImport::createDatabase()
if ( sqlite3_exec( mDatabase, sqlInitStatements[i], 0, 0, &errMsg ) != SQLITE_OK )
{
mError = QString( "Error executing SQL command:\n%1\nSQL:\n%2" )
.arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sqlInitStatements[i] ) );
.arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sqlInitStatements[i] ) );
sqlite3_free( errMsg );
closeDatabase();
return false;
@@ -201,7 +201,7 @@ bool QgsOSMXmlImport::createDatabase()
{
const char* errMsg = sqlite3_errmsg( mDatabase ); // does not require free
mError = QString( "Error preparing SQL command:\n%1\nSQL:\n%2" )
.arg( QString::fromUtf8( errMsg ) ).arg( QString::fromUtf8( sqlInsertStatements[i] ) );
.arg( QString::fromUtf8( errMsg ), QString::fromUtf8( sqlInsertStatements[i] ) );
closeDatabase();
return false;
}
@@ -272,9 +272,9 @@ bool QgsAlignRaster::checkInputParameters()
mErrorMessage = QString( "Failed to get suggested warp output.\n\n"
"File:\n%1\n\n"
"Source WKT:\n%2\n\nDestination WKT:\n%3" )
.arg( r.inputFilename )
.arg( info.mCrsWkt )
.arg( mCrsWkt );
.arg( r.inputFilename,
info.mCrsWkt,
mCrsWkt );
return false;
}

@@ -118,8 +118,8 @@ void QgsAtlasCompositionWidget::on_mAtlasFilenamePatternEdit_editingFinished()
QMessageBox::warning( this
, tr( "Could not evaluate filename pattern" )
, tr( "Could not set filename pattern as '%1'.\nParser error:\n%2" )
.arg( mAtlasFilenamePatternEdit->text() )
.arg( atlasMap->filenamePatternErrorString() )
.arg( mAtlasFilenamePatternEdit->text(),
atlasMap->filenamePatternErrorString() )
);
}
}
@@ -149,8 +149,8 @@ void QgsAtlasCompositionWidget::on_mAtlasFilenameExpressionButton_clicked()
QMessageBox::warning( this
, tr( "Could not evaluate filename pattern" )
, tr( "Could not set filename pattern as '%1'.\nParser error:\n%2" )
.arg( expression )
.arg( atlasMap->filenamePatternErrorString() )
.arg( expression,
atlasMap->filenamePatternErrorString() )
);
}
}
@@ -410,7 +410,7 @@ void QgsGPSInformationWidget::connectGps()
}
else if ( mRadGpsd->isChecked() )
{
port = QString( "%1:%2:%3" ).arg( mGpsdHost->text() ).arg( mGpsdPort->text() ).arg( mGpsdDevice->text() );
port = QString( "%1:%2:%3" ).arg( mGpsdHost->text(), mGpsdPort->text(), mGpsdDevice->text() );
}
else if ( mRadInternal->isChecked() )
{
@@ -847,8 +847,8 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
QMessageBox::information( this,
tr( "Error" ),
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
.arg( vlayer->name(),
vlayer->commitErrors().join( "\n " ) ) );
}

vlayer->startEditing();
@@ -977,8 +977,8 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
QMessageBox::information( this,
tr( "Error" ),
tr( "Could not commit changes to layer %1\n\nErrors: %2\n" )
.arg( vlayer->name() )
.arg( vlayer->commitErrors().join( "\n " ) ) );
.arg( vlayer->name(),
vlayer->commitErrors().join( "\n " ) ) );
}

vlayer->startEditing();
@@ -947,7 +947,7 @@ int main( int argc, char *argv[] )
}
else
{
qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath ).arg( myTranslationCode ).toLocal8Bit().constData() );
qWarning( "loading of qgis translation failed [%s]", QString( "%1/qgis_%2" ).arg( i18nPath, myTranslationCode ).toLocal8Bit().constData() );
}

/* Translation file for Qt.
@@ -961,7 +961,7 @@ int main( int argc, char *argv[] )
}
else
{
qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ).arg( myTranslationCode ).toLocal8Bit().constData() );
qWarning( "loading of qt translation failed [%s]", QString( "%1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), myTranslationCode ).toLocal8Bit().constData() );
}
}

@@ -343,23 +343,23 @@ QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const
{
QComboBox* cb = mDatasourceOptionsGroupBox->findChild<QComboBox*>( it.key() );
if ( cb && !cb->itemData( cb->currentIndex() ).isNull() )
options << QString( "%1=%2" ).arg( it.key() ).arg( cb->currentText() );
options << QString( "%1=%2" ).arg( it.key(), cb->currentText() );
break;
}

case QgsVectorFileWriter::String:
{
QLineEdit* le = mDatasourceOptionsGroupBox->findChild<QLineEdit*>( it.key() );
if ( le )
options << QString( "%1=%2" ).arg( it.key() ).arg( le->text() );
options << QString( "%1=%2" ).arg( it.key(), le->text() );
break;
}

case QgsVectorFileWriter::Hidden:
{
QgsVectorFileWriter::HiddenOption *opt =
dynamic_cast<QgsVectorFileWriter::HiddenOption*>( it.value() );
options << QString( "%1=%2" ).arg( it.key() ).arg( opt->mValue );
options << QString( "%1=%2" ).arg( it.key(), opt->mValue );
break;
}
}
@@ -393,22 +393,22 @@ QStringList QgsVectorLayerSaveAsDialog::layerOptions() const
case QgsVectorFileWriter::Set:
{
QComboBox* cb = mLayerOptionsGroupBox->findChild<QComboBox*>( it.key() );
options << QString( "%1=%2" ).arg( it.key() ).arg( cb->currentText() );
options << QString( "%1=%2" ).arg( it.key(), cb->currentText() );
break;
}

case QgsVectorFileWriter::String:
{
QLineEdit* le = mLayerOptionsGroupBox->findChild<QLineEdit*>( it.key() );
options << QString( "%1=%2" ).arg( it.key() ).arg( le->text() );
options << QString( "%1=%2" ).arg( it.key(), le->text() );
break;
}

case QgsVectorFileWriter::Hidden:
{
QgsVectorFileWriter::HiddenOption *opt =
dynamic_cast<QgsVectorFileWriter::HiddenOption*>( it.value() );
options << QString( "%1=%2" ).arg( it.key() ).arg( opt->mValue );
options << QString( "%1=%2" ).arg( it.key(), opt->mValue );
break;
}
}
@@ -78,7 +78,7 @@ void QgsOSMExportDialog::updateLayerName()
layerType = "polylines";
else
layerType = "polygons";
editLayerName->setText( QString( "%1_%2" ).arg( baseName ).arg( layerType ) );
editLayerName->setText( QString( "%1_%2" ).arg( baseName, layerType ) );
}


@@ -322,7 +322,7 @@ void QgsPluginManager::getCppPluginsMetadata()

for ( uint i = 0; i < pluginDir.count(); i++ )
{
QString lib = QString( "%1/%2" ).arg( myPluginDir ).arg( pluginDir[i] );
QString lib = QString( "%1/%2" ).arg( myPluginDir, pluginDir[i] );

#ifdef TESTLIB
// This doesn't work on windows and causes problems with plugins
@@ -354,7 +354,7 @@ void QgsPluginManager::getCppPluginsMetadata()
bool loaded = myLib->load();
if ( !loaded )
{
QgsDebugMsg( QString( "Failed to load: %1 (%2)" ).arg( myLib->fileName() ).arg( myLib->errorString() ) );
QgsDebugMsg( QString( "Failed to load: %1 (%2)" ).arg( myLib->fileName(), myLib->errorString() ) );
delete myLib;
continue;
}
@@ -680,15 +680,15 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
QString errorMsg;
if ( metadata->value( "error" ) == "incompatible" )
{
errorMsg = QString( "<b>%1</b><br/>%2" ).arg( tr( "This plugin is incompatible with this version of QGIS" ) ).arg( tr( "Plugin designed for QGIS %1", "compatible QGIS version(s)" ).arg( metadata->value( "error_details" ) ) );
errorMsg = QString( "<b>%1</b><br/>%2" ).arg( tr( "This plugin is incompatible with this version of QGIS" ), tr( "Plugin designed for QGIS %1", "compatible QGIS version(s)" ).arg( metadata->value( "error_details" ) ) );
}
else if ( metadata->value( "error" ) == "dependent" )
{
errorMsg = QString( "<b>%1:</b><br/>%2" ).arg( tr( "This plugin requires a missing module" ) ).arg( metadata->value( "error_details" ) );
errorMsg = QString( "<b>%1:</b><br/>%2" ).arg( tr( "This plugin requires a missing module" ), metadata->value( "error_details" ) );
}
else
{
errorMsg = QString( "<b>%1</b><br/>%2" ).arg( tr( "This plugin is broken" ) ).arg( metadata->value( "error_details" ) );
errorMsg = QString( "<b>%1</b><br/>%2" ).arg( tr( "This plugin is broken" ), metadata->value( "error_details" ) );
}
html += QString( "<table bgcolor=\"#FFFF88\" cellspacing=\"2\" cellpadding=\"6\" width=\"100%\">"
" <tr><td width=\"100%\" style=\"color:#CC0000\">%1</td></tr>"
@@ -780,51 +780,51 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )

if ( ! metadata->value( "category" ).isEmpty() )
{
html += QString( "%1: %2 <br/>" ).arg( tr( "Category" ) ).arg( metadata->value( "category" ) );
html += QString( "%1: %2 <br/>" ).arg( tr( "Category" ), metadata->value( "category" ) );
}
if ( ! metadata->value( "tags" ).isEmpty() )
{
html += QString( "%1: %2 <br/>" ).arg( tr( "Tags" ) ).arg( metadata->value( "tags" ) );
html += QString( "%1: %2 <br/>" ).arg( tr( "Tags" ), metadata->value( "tags" ) );
}
if ( ! metadata->value( "homepage" ).isEmpty() || ! metadata->value( "tracker" ).isEmpty() || ! metadata->value( "code_repository" ).isEmpty() )
{
html += QString( "%1: " ).arg( tr( "More info" ) );
if ( ! metadata->value( "homepage" ).isEmpty() )
{
html += QString( "<a href='%1'>%2</a> &nbsp; " ).arg( metadata->value( "homepage" ) ).arg( tr( "homepage" ) );
html += QString( "<a href='%1'>%2</a> &nbsp; " ).arg( metadata->value( "homepage" ), tr( "homepage" ) );
}
if ( ! metadata->value( "tracker" ).isEmpty() )
{
html += QString( "<a href='%1'>%2</a> &nbsp; " ).arg( metadata->value( "tracker" ) ).arg( tr( "tracker" ) );
html += QString( "<a href='%1'>%2</a> &nbsp; " ).arg( metadata->value( "tracker" ), tr( "tracker" ) );
}
if ( ! metadata->value( "code_repository" ).isEmpty() )
{
html += QString( "<a href='%1'>%2</a>" ).arg( metadata->value( "code_repository" ) ).arg( tr( "code_repository" ) );
html += QString( "<a href='%1'>%2</a>" ).arg( metadata->value( "code_repository" ), tr( "code_repository" ) );
}
html += "<br/>";
}
html += "<br/>";

if ( ! metadata->value( "author_email" ).isEmpty() )
{
html += QString( "%1: <a href='mailto:%2'>%3</a>" ).arg( tr( "Author" ) ).arg( metadata->value( "author_email" ) ).arg( metadata->value( "author_name" ) );
html += QString( "%1: <a href='mailto:%2'>%3</a>" ).arg( tr( "Author" ), metadata->value( "author_email" ), metadata->value( "author_name" ) );
html += "<br/><br/>";
}
else if ( ! metadata->value( "author_name" ).isEmpty() )
{
html += QString( "%1: %2" ).arg( tr( "Author" ) ).arg( metadata->value( "author_name" ) );
html += QString( "%1: %2" ).arg( tr( "Author" ), metadata->value( "author_name" ) );
html += "<br/><br/>";
}

if ( ! metadata->value( "version_installed" ).isEmpty() )
{
QString ver = metadata->value( "version_installed" );
if ( ver == "-1" ) ver = "?";
html += tr( "Installed version: %1 (in %2)<br/>" ).arg( ver ).arg( metadata->value( "library" ) );
html += tr( "Installed version: %1 (in %2)<br/>" ).arg( ver, metadata->value( "library" ) );
}
if ( ! metadata->value( "version_available" ).isEmpty() )
{
html += tr( "Available version: %1 (in %2)<br/>" ).arg( metadata->value( "version_available" ) ).arg( metadata->value( "zip_repository" ) );
html += tr( "Available version: %1 (in %2)<br/>" ).arg( metadata->value( "version_available" ), metadata->value( "zip_repository" ) );
}

if ( ! metadata->value( "changelog" ).isEmpty() )
@@ -1160,8 +1160,8 @@ void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url )
QString params = url.path();
QString response;
QgsPythonRunner::eval( QString( "pyplugin_installer.instance().sendVote('%1', '%2')" )
.arg( params.split( "/" )[1] )
.arg( params.split( "/" )[2] ), response );
.arg( params.split( "/" )[1],
params.split( "/" )[2] ), response );
if ( response == "True" )
{
pushMessage( tr( "Vote sent successfully" ), QgsMessageBar::INFO );
@@ -1460,7 +1460,7 @@ void QgsPluginManager::updateWindowTitle()
QListWidgetItem *curitem = mOptListWidget->currentItem();
if ( curitem )
{
QString title = QString( "%1 | %2" ).arg( tr( "Plugins" ) ).arg( curitem->text() );
QString title = QString( "%1 | %2" ).arg( tr( "Plugins" ), curitem->text() );
if ( mOptionsListWidget->currentRow() < mOptionsListWidget->count() - 1 )
{
// if it's not the Settings tab, add the plugin count

0 comments on commit 5ed3d1b

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