Skip to content

Commit

Permalink
Remove unnecessary check, Add const, fix text case
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Oct 6, 2021
1 parent 77ef4a9 commit 9e37db3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/gui/editorwidgets/qgsexternalresourceconfigdlg.cpp
Expand Up @@ -120,7 +120,7 @@ void QgsExternalResourceConfigDlg::chooseDefaultPath()
dir = QgsSettings().value( QStringLiteral( "/UI/lastExternalResourceWidgetDefaultPath" ), QDir::toNativeSeparators( QDir::cleanPath( path ) ) ).toString();
}

const QString rootName = QFileDialog::getExistingDirectory( this, tr( "Select a directory" ), dir, QFileDialog::ShowDirsOnly );
const QString rootName = QFileDialog::getExistingDirectory( this, tr( "Select a Directory" ), dir, QFileDialog::ShowDirsOnly );

if ( !rootName.isNull() )
mRootPath->setText( rootName );
Expand All @@ -129,7 +129,7 @@ void QgsExternalResourceConfigDlg::chooseDefaultPath()
void QgsExternalResourceConfigDlg::enableCbxItem( QComboBox *comboBox, int index, bool enabled )
{
// https://stackoverflow.com/a/62261745
auto *model = qobject_cast<QStandardItemModel *>( comboBox->model() );
const auto *model = qobject_cast<QStandardItemModel *>( comboBox->model() );
assert( model );
if ( !model )
return;
Expand Down Expand Up @@ -247,10 +247,6 @@ void QgsExternalResourceConfigDlg::setConfig( const QVariantMap &config )
if ( config.contains( QStringLiteral( "RelativeStorage" ) ) )
{
const int relative = config.value( QStringLiteral( "RelativeStorage" ) ).toInt();

if ( ( QgsFileWidget::RelativeStorage )relative == QgsFileWidget::RelativeDefaultPath )
enableCbxItem( mStoragePathCbx, 2, true );

mStoragePathCbx->setCurrentIndex( relative );
}

Expand Down

0 comments on commit 9e37db3

Please sign in to comment.