forked from Silverfish/proton-bridge
fix(GODT-2932): fix syncing not being reported in GUI.
This commit is contained in:
@ -262,7 +262,7 @@ void UserList::onUsedBytesChanged(QString const &userID, qint64 usedBytes) {
|
|||||||
void UserList::onSyncStarted(QString const &userID) {
|
void UserList::onSyncStarted(QString const &userID) {
|
||||||
int const index = this->rowOfUserID(userID);
|
int const index = this->rowOfUserID(userID);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
app().log().error(QString("Received onSyncStarted event for unknown userID %1").arg(userID));
|
app().log().error(QString("Received syncStarted event for unknown userID %1").arg(userID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
users_[index]->setIsSyncing(true);
|
users_[index]->setIsSyncing(true);
|
||||||
@ -275,7 +275,7 @@ void UserList::onSyncStarted(QString const &userID) {
|
|||||||
void UserList::onSyncFinished(QString const &userID) {
|
void UserList::onSyncFinished(QString const &userID) {
|
||||||
int const index = this->rowOfUserID(userID);
|
int const index = this->rowOfUserID(userID);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
app().log().error(QString("Received onSyncFinished event for unknown userID %1").arg(userID));
|
app().log().error(QString("Received syncFinished event for unknown userID %1").arg(userID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
users_[index]->setIsSyncing(false);
|
users_[index]->setIsSyncing(false);
|
||||||
@ -293,7 +293,7 @@ void UserList::onSyncProgress(QString const &userID, double progress, float elap
|
|||||||
Q_UNUSED(remainingMs)
|
Q_UNUSED(remainingMs)
|
||||||
int const index = this->rowOfUserID(userID);
|
int const index = this->rowOfUserID(userID);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
app().log().error(QString("Received onSyncFinished event for unknown userID %1").arg(userID));
|
app().log().error(QString("Received syncProgress event for unknown userID %1").arg(userID));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
users_[index]->setSyncProgress(progress);
|
users_[index]->setSyncProgress(progress);
|
||||||
|
|||||||
@ -325,6 +325,10 @@ float User::syncProgress() const {
|
|||||||
/// \param[in] progress The progress ratio.
|
/// \param[in] progress The progress ratio.
|
||||||
//****************************************************************************************************************************************************
|
//****************************************************************************************************************************************************
|
||||||
void User::setSyncProgress(float progress) {
|
void User::setSyncProgress(float progress) {
|
||||||
|
// In some cases, we may have missed the syncStarted event because it was sent by bridge before the userChanged event,
|
||||||
|
// so we force the state to 'syncing' (GODT-2932).
|
||||||
|
this->setIsSyncing(true);
|
||||||
|
|
||||||
if (qAbs(syncProgress_ - progress) < 0.00001) {
|
if (qAbs(syncProgress_ - progress) < 0.00001) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user