Commit 0bd27c67 authored by Maik Qualmann's avatar Maik Qualmann

also check SQLite for database rights

BUGS: 418594
FIXED-IN: 7.0.0
parent 97ebe7c8
......@@ -652,4 +652,5 @@ BUGFIXES:
634 ==> 418138 - Export to local storage not working on Windows machine.
635 ==> 418057 - Icons missing in xubuntu.
636 ==> 418446 - Move Filters menu from right to left side of main window.
637 ==>
637 ==> 418594 - Should warn the user immediately when database not writable.
638 ==>
......@@ -201,30 +201,27 @@ void CoreDbSchemaUpdater::setObserver(InitializationObserver* const observer)
bool CoreDbSchemaUpdater::startUpdates()
{
if (!d->parameters.isSQLite())
{
// Do we have sufficient privileges
QStringList insufficientRights;
CoreDbPrivilegesChecker checker(d->parameters);
if (!checker.checkPrivileges(insufficientRights))
{
qCDebug(DIGIKAM_COREDB_LOG) << "Core database: insufficient rights on database.";
// Do we have sufficient privileges
QStringList insufficientRights;
CoreDbPrivilegesChecker checker(d->parameters);
QString errorMsg = i18n("You have insufficient privileges on the database.\n"
"Following privileges are not assigned to you:\n %1\n"
"Check your privileges on the database and restart digiKam.",
insufficientRights.join(QLatin1String(",\n")));
d->lastErrorMessage = errorMsg;
if (!checker.checkPrivileges(insufficientRights))
{
qCDebug(DIGIKAM_COREDB_LOG) << "Core database: insufficient rights on database.";
if (d->observer)
{
d->observer->error(errorMsg);
d->observer->finishedSchemaUpdate(InitializationObserver::UpdateErrorMustAbort);
}
QString errorMsg = i18n("You have insufficient privileges on the database.\n"
"Following privileges are not assigned to you:\n %1\n"
"Check your privileges on the database and restart digiKam.",
insufficientRights.join(QLatin1String(",\n")));
d->lastErrorMessage = errorMsg;
return false;
if (d->observer)
{
d->observer->error(errorMsg);
d->observer->finishedSchemaUpdate(InitializationObserver::UpdateErrorMustAbort);
}
return false;
}
// First step: do we have an empty database?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment