Skip to content

Commit

Permalink
Avoid some unnecessary QString construction
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 9, 2015
1 parent 910cb01 commit dbded4d
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 178 deletions.
6 changes: 3 additions & 3 deletions src/app/main.cpp
Expand Up @@ -810,9 +810,9 @@ APP_EXPORT int main( int argc, char *argv[] )
if ( mySettings.contains( "/Themes" ) )
{
QString theme = mySettings.value( "/Themes", "default" ).toString();
if ( theme == QString( "gis" )
|| theme == QString( "classic" )
|| theme == QString( "nkids" ) )
if ( theme == "gis"
|| theme == "classic"
|| theme == "nkids" )
{
mySettings.setValue( "/Themes", QString( "default" ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/pluginmanager/qgspluginitemdelegate.cpp
Expand Up @@ -88,8 +88,8 @@ void QgsPluginItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
}

if ( ! index.data( PLUGIN_ERROR_ROLE ).toString().isEmpty()
|| index.data( PLUGIN_STATUS_ROLE ).toString() == QString( "upgradeable" )
|| index.data( PLUGIN_STATUS_ROLE ).toString() == QString( "new" ) )
|| index.data( PLUGIN_STATUS_ROLE ).toString() == "upgradeable"
|| index.data( PLUGIN_STATUS_ROLE ).toString() == "new" )
{
QFont font = painter->font();
font.setBold( true );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -1680,7 +1680,7 @@ void QgsOptions::on_mOptionsStackedWidget_currentChanged( int theIndx )
{
Q_UNUSED( theIndx );
// load gdal driver list when gdal tab is first opened
if ( mOptionsStackedWidget->currentWidget()->objectName() == QString( "mOptionsPageGDAL" )
if ( mOptionsStackedWidget->currentWidget()->objectName() == "mOptionsPageGDAL"
&& ! mLoadedGdalDriverList )
{
loadGdalDriverList();
Expand Down
6 changes: 3 additions & 3 deletions src/browser/main.cpp
Expand Up @@ -37,9 +37,9 @@ int main( int argc, char ** argv )
QgsApplication a( argc, argv, true );
// update any saved setting for older themes to new default 'gis' theme (2013-04-15)
QString theme = settings.value( "/Themes", "default" ).toString();
if ( theme == QString( "gis" )
|| theme == QString( "classic" )
|| theme == QString( "nkids" ) )
if ( theme == "gis"
|| theme == "classic"
|| theme == "nkids" )
{
theme = QString( "default" );
}
Expand Down

0 comments on commit dbded4d

Please sign in to comment.