зеркало из https://github.com/nextcloud/desktop.git
avoid displaying the same encryption error twice
remove duplicated handling of the same server error Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Родитель
587765d083
Коммит
cb9a38fac1
|
@ -357,8 +357,12 @@ void ShareModel::initShareManager()
|
|||
connect(_manager.data(), &ShareManager::linkShareCreated, this, &ShareModel::slotAddShare);
|
||||
connect(_manager.data(), &ShareManager::linkShareRequiresPassword, this, &ShareModel::requestPasswordForLinkShare);
|
||||
connect(_manager.data(), &ShareManager::serverError, this, [this](const int code, const QString &message) {
|
||||
if (!_hasInitialShareFetchCompleted) {
|
||||
_hasInitialShareFetchCompleted = true;
|
||||
Q_EMIT hasInitialShareFetchCompletedChanged();
|
||||
}
|
||||
|
||||
qCWarning(lcShareModel) << "Error from server from ShareManager class and initShareManager" << code << message;
|
||||
emit serverError(code, message);
|
||||
});
|
||||
|
||||
|
@ -597,7 +601,10 @@ void ShareModel::slotAddShare(const SharePtr &share)
|
|||
const QPersistentModelIndex sharePersistentIndex(shareModelIndex);
|
||||
_shareIdIndexHash.insert(shareId, sharePersistentIndex);
|
||||
|
||||
connect(share.data(), &Share::serverError, this, &ShareModel::slotServerError);
|
||||
connect(share.data(), &Share::serverError, this, [this] (int code, const QString &message) {
|
||||
qCWarning(lcShareModel) << "Error from server from Share class" << code << message;
|
||||
Q_EMIT serverError(code, message);
|
||||
});
|
||||
connect(share.data(), &Share::passwordSetError, this, [this, shareId](const int code, const QString &message) {
|
||||
_shareIdRecentlySetPasswords.remove(shareId);
|
||||
slotSharePasswordSet(shareId);
|
||||
|
@ -620,10 +627,6 @@ void ShareModel::slotAddShare(const SharePtr &share)
|
|||
connect(userGroupShare.data(), &UserGroupShare::expireDateSet, this, [this, shareId]{ slotShareExpireDateSet(shareId); });
|
||||
}
|
||||
|
||||
if (_manager) {
|
||||
connect(_manager.data(), &ShareManager::serverError, this, &ShareModel::slotServerError);
|
||||
}
|
||||
|
||||
handleLinkShare();
|
||||
Q_EMIT sharesChanged();
|
||||
}
|
||||
|
@ -672,12 +675,6 @@ void ShareModel::slotRemoveShareWithId(const QString &shareId)
|
|||
Q_EMIT sharesChanged();
|
||||
}
|
||||
|
||||
void ShareModel::slotServerError(const int code, const QString &message)
|
||||
{
|
||||
qCWarning(lcShareModel) << "Error from server" << code << message;
|
||||
Q_EMIT serverError(code, message);
|
||||
}
|
||||
|
||||
void ShareModel::slotAddSharee(const ShareePtr &sharee)
|
||||
{
|
||||
if(!sharee) {
|
||||
|
|
|
@ -200,7 +200,6 @@ private slots:
|
|||
void setHideDownloadEnabledChangeInProgress(const QString &shareId, const bool isInProgress);
|
||||
|
||||
void slotPropfindReceived(const QVariantMap &result);
|
||||
void slotServerError(const int code, const QString &message);
|
||||
void slotAddShare(const OCC::SharePtr &share);
|
||||
void slotRemoveShareWithId(const QString &shareId);
|
||||
void slotSharesFetched(const QList<OCC::SharePtr> &shares);
|
||||
|
|
Загрузка…
Ссылка в новой задаче