mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-14 09:48:53 +03:00
AccountSettings: Update progress only twice per second. #3014
This commit is contained in:
parent
d1e46056ae
commit
0f33e266ce
2 changed files with 12 additions and 0 deletions
|
@ -119,6 +119,8 @@ AccountSettings::AccountSettings(QWidget *parent) :
|
|||
connect(folderMan, SIGNAL(folderListLoaded(Folder::Map)),
|
||||
this, SLOT(setFolderList(Folder::Map)));
|
||||
setFolderList(FolderMan::instance()->map());
|
||||
|
||||
_lastProgressUpdate.start();
|
||||
}
|
||||
|
||||
void AccountSettings::slotAccountStateChanged(AccountState *newAccountState)
|
||||
|
@ -607,6 +609,15 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
|
|||
return;
|
||||
}
|
||||
|
||||
// Don't update progess too often.
|
||||
const int msBetweenProgressUpdates = 500;
|
||||
if (_lastProgressUpdate.elapsed() < msBetweenProgressUpdates) {
|
||||
qDebug() << "skip progress";
|
||||
return;
|
||||
}
|
||||
_lastProgressUpdate.restart();
|
||||
|
||||
|
||||
if(!progress._lastCompletedItem.isEmpty()
|
||||
&& Progress::isWarningKind(progress._lastCompletedItem._status)) {
|
||||
int warnCount = item->data(FolderStatusDelegate::WarningCount).toInt();
|
||||
|
|
|
@ -98,6 +98,7 @@ private:
|
|||
QStringList _generalErrors;
|
||||
bool _wasDisabledBefore;
|
||||
AccountState *_accountState;
|
||||
QElapsedTimer _lastProgressUpdate;
|
||||
private slots:
|
||||
void slotFolderSyncStateChange();
|
||||
void slotAccountStateChanged(AccountState*);
|
||||
|
|
Loading…
Reference in a new issue