// Move to the last row.
countCookiesQuery.last();
- // Get the number of rows (which is zero based).
- int numberOfCookies = countCookiesQuery.at() + 1;
+ // Initialize a number of cookies variable.
+ int numberOfCookies = 0;
+
+ // Check to see if the query is valid (there is at least one cookie).
+ if (countCookiesQuery.isValid())
+ {
+ // Get the number of rows (which is zero based) and add one to calculate the number of cookies.
+ numberOfCookies = countCookiesQuery.at() + 1;
+ }
// Return the number of cookies.
return numberOfCookies;
(isUpdateQuery.value(2).toBool() != cookie.isSecure()) ||
(isUpdateQuery.value(3).toString().toUtf8() != cookie.value())) // The cookies data has changed.
{
- qDebug() << "The durable cookie data has changed.";
+ //qDebug() << "The durable cookie data has changed.";
// Return true.
return true;
}
else // The cookie data has not changed.
{
- qDebug() << "The durable cookie data is unchanged.";
+ //qDebug() << "The durable cookie data is unchanged.";
// Return false.
return false;