Don't go though the list of dirs/devs for every dir/dev change event. Just
go though the list once after receiving new events. This makes also the
code a little bit easier to follow.
* Improve code for reading environment variables
* Make tests work when the temp directory is not `/tmp` because e.g. `TEMP`
has been set or tests are executed under Windows
Apparently the default before introducing the request timeout was not 30000
(which is the value of QNetworkRequest::TransferTimeoutConstant). There was
actually no timeout. So let's restore this behavior for now as the main
intention was to make the timeout configurable but not change any defaults.
Apparently this is still problematic leading to errors like
`Qualifying with unknown namespace/class`. It seems that moving the enum to
a different header file works. The trick to use a macro to define
`enum class` ceased to work on the other hand.
Specifying a function with the namespace like
`void QtGui::FinalWizardPage::showResults()` leads to the same problem and
also needs to be avoided.
* This is now required after 843f164d which uses event IDs
instead of time stamps and event IDs reset when Syncthing has
been restarted.
* It is likely a good idea to cleanly re-connect anyways.
* This change re-introduces the previously uneffective and hence
removed code (see 8c74b240). It fixes the code to effectively
make sure a re-connect is continued once it has been started.
So this change should fix the re-connect not working in
certain cases.
Calling `handleAdditionalRequestCanceled();` when `handleAborting`
is true is useless because then also `m_abortingAllRequests` is true
and therefore `handleAdditionalRequestCanceled();` always returns
early doing nothing.
When connecting again, no data is cleared. Since we now keep
track of event IDs and not just timestamps it makes sense to not
forget what the last event IDs were. To still run into the
"limit" case the flags for having events at all can be used
(which is also reset on just `connect()`).