summaryrefslogtreecommitdiff
path: root/ui/qt/splash_overlay.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-08-07 12:37:33 -0700
committerGerald Combs <gerald@wireshark.org>2015-08-07 20:23:07 +0000
commit240105eaecddb44bebde2f9b470bade395131416 (patch)
tree2a0cd89502ea11c001a3e6445716df209e83546e /ui/qt/splash_overlay.cpp
parent0a1d1bdb37b2b0857a0f237ac18f8998613e7ee0 (diff)
downloadwireshark-240105eaecddb44bebde2f9b470bade395131416.tar.gz
Fixup the Qt splash overlay progress calculations.
Fix a couple of issues in the way we calculate the splash overlay progress. Avoid unnecessary repaints. Change-Id: I1f4800b2c2836b67ca9ff3d6d24af150f4379ba9 Reviewed-on: https://code.wireshark.org/review/9916 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/splash_overlay.cpp')
-rw-r--r--ui/qt/splash_overlay.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/ui/qt/splash_overlay.cpp b/ui/qt/splash_overlay.cpp
index b6343645f9..df5dece034 100644
--- a/ui/qt/splash_overlay.cpp
+++ b/ui/qt/splash_overlay.cpp
@@ -53,12 +53,9 @@ SplashOverlay::SplashOverlay(QWidget *parent) :
{
so_ui_->setupUi(this);
- /* additional 6 for:
- * dissectors, listeners,
- * registering plugins, handingoff plugins,
- * preferences and configuration
- */
- int register_add = 6;
+ // Number of register action transitions (e.g. RA_NONE -> RA_DISSECTORS,
+ // RA_DISSECTORS -> RA_PLUGIN_REGISTER) minus two.
+ int register_add = 4;
#ifdef HAVE_LUA
register_add += wslua_count_plugins(); /* get count of lua plugins */
#endif
@@ -118,15 +115,16 @@ void SplashOverlay::splashUpdate(register_action_e action, const char *message)
QString action_msg = UTF8_HORIZONTAL_ELLIPSIS;
#ifdef THROTTLE_STARTUP
- ThrottleThread::msleep(100);
+ ThrottleThread::msleep(10);
#endif
register_cur_++;
- if (last_action_ == action && time_.elapsed() < info_update_freq_ && register_cur_ < so_ui_->progressBar->maximum()) {
+ if (last_action_ == action && time_.elapsed() < info_update_freq_ && register_cur_ != so_ui_->progressBar->maximum()) {
/* Only update every splash_register_freq milliseconds */
return;
}
last_action_ = action;
+ time_.restart();
switch(action) {
case RA_DISSECTORS:
@@ -170,12 +168,9 @@ void SplashOverlay::splashUpdate(register_action_e action, const char *message)
}
so_ui_->actionLabel->setText(action_msg);
- register_cur_++;
so_ui_->progressBar->setValue(register_cur_);
wsApp->processEvents();
-
- time_.restart();
}
void SplashOverlay::paintEvent(QPaintEvent *)