Skip to content

Commit

Permalink
More deprecation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 29, 2020
1 parent b0bffba commit bfffd53
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -2379,7 +2379,11 @@ int QgisApp::chooseReasonableDefaultIconSize() const
}
else
{
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
double size = fontMetrics().width( QStringLiteral( "XXX" ) );
#else
double size = fontMetrics().horizontalAdvance( 'X' ) * 3;
#endif
if ( size < 24 )
return 16;
else if ( size < 32 )
Expand Down Expand Up @@ -13625,7 +13629,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
mActionAddFeature->setToolTip( addFeatureText );
QgsGui::shortcutsManager()->unregisterAction( mActionAddFeature );
if ( !mActionAddFeature->text().isEmpty() ) // The text will be empty on unknown geometry type -> in this case do not create a shortcut
QgsGui::shortcutsManager()->registerAction( mActionAddFeature, mActionAddFeature->shortcut() );
QgsGui::shortcutsManager()->registerAction( mActionAddFeature, mActionAddFeature->shortcut().toString() );
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion src/core/auth/qgsauthmanager.cpp
Expand Up @@ -2567,7 +2567,10 @@ const QList<QSslCertificate> QgsAuthManager::extraFileCAs()
// only CAs or certs capable of signing other certs are allowed
for ( const auto &cert : qgis::as_const( filecerts ) )
{
if ( !allowinvalid.toBool() && !cert.isValid() )
if ( !allowinvalid.toBool() && ( cert.isBlacklisted()
|| cert.isNull()
|| cert.expiryDate() <= QDateTime::currentDateTime()
|| cert.effectiveDate() > QDateTime::currentDateTime() ) )
{
continue;
}
Expand Down
16 changes: 13 additions & 3 deletions src/gui/auth/qgsauthauthoritieseditor.cpp
Expand Up @@ -287,7 +287,11 @@ void QgsAuthAuthoritiesEditor::appendCertsToItem( const QList<QSslCertificate> &
{
policy = QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::Trusted );
}
else if ( untrustedids.contains( id ) || !cert.isValid() )
else if ( untrustedids.contains( id )
|| cert.isBlacklisted()
|| cert.isNull()
|| cert.expiryDate() <= QDateTime::currentDateTime()
|| cert.effectiveDate() > QDateTime::currentDateTime() )
{
policy = QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::Untrusted );
}
Expand All @@ -296,7 +300,10 @@ void QgsAuthAuthoritiesEditor::appendCertsToItem( const QList<QSslCertificate> &
QTreeWidgetItem *item( new QTreeWidgetItem( parent, coltxts, static_cast<int>( catype ) ) );

item->setIcon( 0, QgsApplication::getThemeIcon( QStringLiteral( "/mIconCertificate.svg" ) ) );
if ( !cert.isValid() )
if ( cert.isBlacklisted()
|| cert.isNull()
|| cert.expiryDate() <= QDateTime::currentDateTime()
|| cert.effectiveDate() > QDateTime::currentDateTime() )
{
item->setForeground( 2, redb );
item->setIcon( 0, QgsApplication::getThemeIcon( QStringLiteral( "/mIconCertificateUntrusted.svg" ) ) );
Expand All @@ -305,7 +312,10 @@ void QgsAuthAuthoritiesEditor::appendCertsToItem( const QList<QSslCertificate> &
if ( trustedids.contains( id ) )
{
item->setForeground( 3, greenb );
if ( cert.isValid() )
if ( !cert.isBlacklisted()
&& !cert.isNull()
&& cert.expiryDate() > QDateTime::currentDateTime()
&& cert.effectiveDate() <= QDateTime::currentDateTime() )
{
item->setIcon( 0, QgsApplication::getThemeIcon( QStringLiteral( "/mIconCertificateTrusted.svg" ) ) );
}
Expand Down
Expand Up @@ -98,9 +98,9 @@ void QgsGeometryCheckerFixSummaryDialog::setupTable( QTableWidget *table )
{
table->resizeColumnToContents( 0 );
table->resizeColumnToContents( 1 );
table->horizontalHeader()->setResizeMode( 2, QHeaderView::Stretch );
table->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch );
table->horizontalHeader()->setResizeMode( 4, QHeaderView::Stretch );
table->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::Stretch );
table->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::Stretch );
table->horizontalHeader()->setSectionResizeMode( 4, QHeaderView::Stretch );
table->setEditTriggers( QAbstractItemView::NoEditTriggers );
table->setSelectionBehavior( QAbstractItemView::SelectRows );
table->setSelectionMode( QAbstractItemView::SingleSelection );
Expand Down

0 comments on commit bfffd53

Please sign in to comment.