Skip to content
Permalink
Browse files

More deprecation fixes

  • Loading branch information
nyalldawson committed Jan 28, 2020
1 parent b0bffba commit bfffd53eae208ed3223fa6b93285b2fab808847c
@@ -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 )
@@ -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
{
@@ -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;
}
@@ -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 );
}
@@ -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" ) ) );
@@ -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" ) ) );
}
@@ -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 );

0 comments on commit bfffd53

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