- // Instantiate an HTTP authentication dialog.
- HttpAuthenticationDialog *httpAuthenticationDialogPointer = new HttpAuthenticationDialog(parentWidget(), requestUrl, authenticatorPointer);
+ // Only display the HTTP authentication dialog if it hasn't already been displayed three times for this URL.
+ if (httpAuthenticationDialogsDisplayed < 3) {
+ // Increment the HTTP authentication dialog display counter.
+ ++httpAuthenticationDialogsDisplayed;
+
+ // Instantiate an HTTP authentication dialog.
+ HttpAuthenticationDialog *httpAuthenticationDialogPointer = new HttpAuthenticationDialog(parentWidget(), requestUrl, authenticatorPointer);