Qt: Delay showing game list refresh progress

Otherwise we spend more time updating the visuals than actually
scanning.
This commit is contained in:
Connor McLaughlin
2021-01-24 18:55:35 +10:00
parent a84bf0d8cf
commit ddcc29c8a6
3 changed files with 33 additions and 8 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include "common/progress_callback.h"
#include "common/timer.h"
#include <QtWidgets/QProgressDialog>
class QtProgressCallback final : public QObject, public BaseProgressCallback
@ -7,7 +8,7 @@ class QtProgressCallback final : public QObject, public BaseProgressCallback
Q_OBJECT
public:
QtProgressCallback(QWidget* parent_widget);
QtProgressCallback(QWidget* parent_widget, float show_delay = 0.0f);
~QtProgressCallback();
bool IsCancelled() const override;
@ -28,5 +29,9 @@ public:
void ModalInformation(const char* message) override;
private:
void checkForDelayedShow();
QProgressDialog m_dialog;
Common::Timer m_show_timer;
float m_show_delay;
};