diff options
author | Frerich Raabe <raabe@froglogic.com> | 2015-11-20 12:58:48 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-12-09 13:30:21 +0000 |
commit | 729a282c7c9edf38098f69702234eeabc8a81c06 (patch) | |
tree | 7cfb3f840bb8b08ec33239ac3ef55ecf1eb84b32 /tests | |
parent | 1bd935af655a953213a73598573745b660d5724b (diff) |
Optimized checking validity of target directory value on Windows
QDir::drives() was called on every key press to check whether the
specified drive letter is valid. Alas, this function is quite expensive
on Windows in case there are network drives. In my local tests, a single
call to QDir::drives() would take about 300ms per call (i.e. 0.3s per
key press). This made typing text feel very sluggish.
I first considered fetching the list of drives up front (e.g. when
starting the installer) but this won't handle cases nicely where drives
are added/removed while the installer is running - e.g. USB devices.
Instead, let's use a cooldown timer: only bother checking the entered
path if there was no keypress for some specific time (right now: 200ms,
a value which is based on highly scientific experiments). In addition to
that, also make sure to check the validity when trying to navigate to
the next page -- this takes care of people typing and hitting Return
quickly.
Change-Id: I35e83fff2fd095765ab1b00b44ac1b8bf495af98
Task-number: QTIFW-673
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions