aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-02-01 20:38:04 +0100
committerGerald Combs <gerald@wireshark.org>2018-02-02 00:17:53 +0000
commit8bf837eddc0ab120ad16273b773fa6cd8ec5c9f4 (patch)
tree961e9849283e7c12f276b07278eacb7314202e54 /ui
parent6adc7550a800142a82cc66da3cc4b305f6a985fc (diff)
Qt: Always update splash screen on action change
On a "fast" computer this is needed to find any action which is taking long time during startup. Without this the splash screen may show a random action message happening before the slow action. Also optimize splashUpdate() when nothing to update. Change-Id: I0946353dbcf12e78323361f2cb4410c6c5605d76 Reviewed-on: https://code.wireshark.org/review/25552 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/splash_overlay.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/qt/splash_overlay.cpp b/ui/qt/splash_overlay.cpp
index 00521cd27e..d9e4091c5a 100644
--- a/ui/qt/splash_overlay.cpp
+++ b/ui/qt/splash_overlay.cpp
@@ -124,6 +124,11 @@ void SplashOverlay::splashUpdate(register_action_e action, const char *message)
ThrottleThread::msleep(10);
#endif
+ if (last_action_ == action && (elapsed_timer_.elapsed() < info_update_freq_)) {
+ // Nothing to update yet
+ return;
+ }
+
if (last_action_ != action) {
register_cur_++;
}
@@ -179,10 +184,8 @@ void SplashOverlay::splashUpdate(register_action_e action, const char *message)
so_ui_->progressBar->setValue(register_cur_);
- if (elapsed_timer_.elapsed() > info_update_freq_) {
- wsApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, 1);
- elapsed_timer_.restart();
- }
+ wsApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, 1);
+ elapsed_timer_.restart();
}
/*