Skip to content
Permalink
Browse files

[auth] Add more database warnings to manager

  • Loading branch information
dakcarto committed Oct 2, 2015
1 parent de3069b commit d6b8f9636570a764c7d0377f1da9688ca561f78f
Showing with 15 additions and 2 deletions.
  1. +15 −2 src/core/auth/qgsauthmanager.cpp
@@ -84,7 +84,14 @@ QSqlDatabase QgsAuthManager::authDbConnection() const
authdb = QSqlDatabase::database( connectionname );
}
if ( !authdb.isOpen() )
( void )authdb.open();
{
if ( !authdb.open() )
{
const char* err = QT_TR_NOOP( "Opening of authentication db FAILED" );
QgsDebugMsg( err );
emit messageOut( tr( err ), authManTag(), CRITICAL );
}
}

return authdb;
}
@@ -3232,7 +3239,13 @@ bool QgsAuthManager::authDbQuery( QSqlQuery *query ) const
return false;

query->setForwardOnly( true );
( void )query->exec();
if ( !query->exec() )
{
const char* err = QT_TR_NOOP( "Auth db query exec() FAILED" );
QgsDebugMsg( err );
emit messageOut( tr( err ), authManTag(), WARNING );
return false;
}

if ( query->lastError().isValid() )
{

0 comments on commit d6b8f96

Please sign in to comment.
You can’t perform that action at this time.