diff --git a/src/bugzillaintegration/libbugzilla/apijob.cpp b/src/bugzillaintegration/libbugzilla/apijob.cpp --- a/src/bugzillaintegration/libbugzilla/apijob.cpp +++ b/src/bugzillaintegration/libbugzilla/apijob.cpp @@ -21,6 +21,7 @@ #include "apijob.h" #include +#include #include @@ -53,6 +54,15 @@ setErrorText(job->errorText()); Q_ASSERT(!((KIO::TransferJob*)job)->isErrorPage()); + + // Force a delay on all API actions if configured. This allows + // simulation of slow connections. + static int delay = qEnvironmentVariableIntValue("DRKONQI_HTTP_DELAY_MS"); + if (delay > 0) { + QTimer::singleShot(delay, [this] { emitResult(); }); + return; + } + emitResult(); }); }