+void BrowserWindow::addCookieToList(const QNetworkCookie &newCookie) const
+{
+ // Check to see if the list already contains a cookie with this ID.
+ for (QNetworkCookie existingCookie : *cookieListPointer)
+ {
+ // Remove the old version of the cookie.
+ if (existingCookie.hasSameIdentifier(newCookie)) cookieListPointer->removeOne(existingCookie);
+ }
+
+ // Add the new cookie to the list.
+ cookieListPointer->append(newCookie);
+}
+
+void BrowserWindow::addOrEditDomainSettings() const
+{
+ // Remove the focus from the URL line edit.
+ urlLineEditPointer->clearFocus();
+
+ // Create the domain settings dialog pointer.
+ DomainSettingsDialog *domainSettingsDialogPointer;
+
+ // Run the commands according to the current domain settings status.
+ if (currentDomainSettingsDomain == "") // Domain settings are not currently applied.
+ {
+ // Instruct the domain settings dialog to add a new domain.
+ domainSettingsDialogPointer = new DomainSettingsDialog(DomainSettingsDialog::ADD_DOMAIN, currentUrl.host());
+ }
+ else // Domain settings are currently applied.
+ {
+ // Instruct the domain settings dialog to edit the current domain.
+ domainSettingsDialogPointer = new DomainSettingsDialog(DomainSettingsDialog::EDIT_DOMAIN, currentDomainSettingsDomain);
+ }
+
+ // Set the dialog window title.
+ domainSettingsDialogPointer->setWindowTitle(i18nc("The domain settings dialog title", "Domain Settings"));
+
+ // Set the modality.
+ domainSettingsDialogPointer->setWindowModality(Qt::WindowModality::WindowModal);;
+
+ // Show the dialog.
+ domainSettingsDialogPointer->show();
+
+ // Reload the tabs when domain settings are updated.
+ connect(domainSettingsDialogPointer, SIGNAL(domainSettingsUpdated()), browserViewPointer, SLOT(applyDomainSettingsAndReload()));
+}
+