diff --git a/src/keeshare/ShareObserver.cpp b/src/keeshare/ShareObserver.cpp index fdd5ccf39..8f2e2c3ab 100644 --- a/src/keeshare/ShareObserver.cpp +++ b/src/keeshare/ShareObserver.cpp @@ -367,21 +367,23 @@ ShareObserver::Result ShareObserver::importSingedContainerInto(const KeeShareSet case UntrustedForever: case TrustedForever: { bool found = false; - const auto trusted = - trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted : KeeShareSettings::Trust::Untrusted; + const auto trusted = trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted + : KeeShareSettings::Trust::Untrusted; for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) { if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) { scopedCertificate.certificate.signer = trust.second.signer; scopedCertificate.path = reference.path; scopedCertificate.trust = trusted; found = true; + break; } } if (!found) { foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted}; - // we need to update with the new signer - KeeShare::setForeign(foreign); } + // update foreign certificates with new settings + KeeShare::setForeign(foreign); + if (trust.first == TrustedForever) { qDebug("Synchronize %s %s with %s", qPrintable(reference.path), @@ -452,21 +454,23 @@ ShareObserver::Result ShareObserver::importUnsignedContainerInto(const KeeShareS case UntrustedForever: case TrustedForever: { bool found = false; - const auto trusted = - trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted : KeeShareSettings::Trust::Untrusted; + const auto trusted = trust.first == TrustedForever ? KeeShareSettings::Trust::Trusted + : KeeShareSettings::Trust::Untrusted; for (KeeShareSettings::ScopedCertificate& scopedCertificate : foreign.certificates) { if (scopedCertificate.certificate.key == trust.second.key && scopedCertificate.path == reference.path) { scopedCertificate.certificate.signer = trust.second.signer; scopedCertificate.path = reference.path; scopedCertificate.trust = trusted; found = true; + break; } } if (!found) { foreign.certificates << KeeShareSettings::ScopedCertificate{reference.path, trust.second, trusted}; - // we need to update with the new signer - KeeShare::setForeign(foreign); } + // update foreign certificates with new settings + KeeShare::setForeign(foreign); + if (trust.first == TrustedForever) { qDebug("Synchronize %s %s with %s", qPrintable(reference.path), diff --git a/src/keeshare/group/EditGroupWidgetKeeShare.cpp b/src/keeshare/group/EditGroupWidgetKeeShare.cpp index bb2cc19ae..253bb9819 100644 --- a/src/keeshare/group/EditGroupWidgetKeeShare.cpp +++ b/src/keeshare/group/EditGroupWidgetKeeShare.cpp @@ -127,6 +127,8 @@ void EditGroupWidgetKeeShare::showSharingState() .arg(supportedExtensions.join(", ")), MessageWidget::Warning); return; + } else { + m_ui->messageWidget->hide(); } } const auto active = KeeShare::active();