mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 04:08:54 +03:00
Fix sequence for recently changed items.
This commit is contained in:
parent
1a7c89326b
commit
c3b82e6818
3 changed files with 14 additions and 11 deletions
|
@ -552,9 +552,9 @@ void Application::rebuildRecentMenus()
|
||||||
_recentActionsMenu->addAction(tr("No items synced recently"));
|
_recentActionsMenu->addAction(tr("No items synced recently"));
|
||||||
} else {
|
} else {
|
||||||
QListIterator<Progress::Info> i(progressInfoList);
|
QListIterator<Progress::Info> i(progressInfoList);
|
||||||
i.toBack();
|
|
||||||
while(i.hasPrevious()) {
|
while(i.hasNext()) {
|
||||||
Progress::Info info = i.previous();
|
Progress::Info info = i.next();
|
||||||
QString kindStr = Progress::asResultString(info.kind);
|
QString kindStr = Progress::asResultString(info.kind);
|
||||||
QString timeStr = info.timestamp.toString("hh:mm");
|
QString timeStr = info.timestamp.toString("hh:mm");
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ ProgressDispatcher* ProgressDispatcher::instance() {
|
||||||
|
|
||||||
ProgressDispatcher::ProgressDispatcher(QObject *parent) :
|
ProgressDispatcher::ProgressDispatcher(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
_problemQueueSize(50)
|
_QueueSize(50)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -163,9 +163,9 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
||||||
err.error_code = newProgress.current_file_bytes;
|
err.error_code = newProgress.current_file_bytes;
|
||||||
err.timestamp = QDateTime::currentDateTime();
|
err.timestamp = QDateTime::currentDateTime();
|
||||||
|
|
||||||
_recentProblems.enqueue( err );
|
_recentProblems.prepend( err );
|
||||||
if( _recentProblems.size() > _problemQueueSize ) {
|
if( _recentProblems.size() > _QueueSize ) {
|
||||||
_recentProblems.dequeue();
|
_recentProblems.removeLast();
|
||||||
}
|
}
|
||||||
emit progressSyncProblem( folder, err );
|
emit progressSyncProblem( folder, err );
|
||||||
} else {
|
} else {
|
||||||
|
@ -180,7 +180,10 @@ void ProgressDispatcher::setProgressInfo(const QString& folder, const Progress::
|
||||||
if( newProgress.kind == Progress::EndDownload ||
|
if( newProgress.kind == Progress::EndDownload ||
|
||||||
newProgress.kind == Progress::EndUpload ||
|
newProgress.kind == Progress::EndUpload ||
|
||||||
newProgress.kind == Progress::EndDelete ) {
|
newProgress.kind == Progress::EndDelete ) {
|
||||||
_recentChanges.enqueue(newProgress);
|
_recentChanges.prepend(newProgress);
|
||||||
|
if( _recentChanges.size() > _QueueSize ) {
|
||||||
|
_recentChanges.removeLast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// store the last real action to help clients that start during
|
// store the last real action to help clients that start during
|
||||||
// the Context-phase of an upload or download.
|
// the Context-phase of an upload or download.
|
||||||
|
|
|
@ -111,9 +111,9 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProgressDispatcher(QObject* parent = 0);
|
ProgressDispatcher(QObject* parent = 0);
|
||||||
const int _problemQueueSize;
|
const int _QueueSize;
|
||||||
QQueue<Progress::Info> _recentChanges;
|
QList<Progress::Info> _recentChanges;
|
||||||
QQueue<Progress::SyncProblem> _recentProblems;
|
QList<Progress::SyncProblem> _recentProblems;
|
||||||
|
|
||||||
QHash<QString, Progress::Kind> _currentAction;
|
QHash<QString, Progress::Kind> _currentAction;
|
||||||
static ProgressDispatcher* _instance;
|
static ProgressDispatcher* _instance;
|
||||||
|
|
Loading…
Reference in a new issue