+ // Get the durable status.
+ const bool isDurable = durableCheckBoxPointer->isChecked();
+
+ // Update the durable cookies database.
+ if (originalIsDurable) // The cookie is currently in the durable cookies database.
+ {
+ if (isDurable) // Update the cookie in the database.
+ {
+ qDebug() << "Updating a durable cookie.";
+
+ // Update the cookie in the durable cookies database.
+ CookiesDatabase::updateCookie(originalCookie, cookie);
+ }
+ else // Delete the cookie from the database.
+ {
+ qDebug() << "Deleting a durable cookie.";
+
+ // Delete the cookie from the durable cookies database.
+ CookiesDatabase::deleteCookie(originalCookie);
+ }
+ }
+ else if (isDurable) // The cookie is being added to the durable cookies database.
+ {
+ qDebug() << "Adding a durable cookie.";
+
+ // Add the cookie to the durable cookies database.
+ CookiesDatabase::addCookie(cookie);
+ }
+
+ // Add the cookie to the store, the list, and the tree.
+ emit addCookie(cookie, isDurable);