[KPhotoAlbum] Patch to use the right database driver

Tobias Leupold tobias.leupold at gmx.de
Sun Jan 7 12:36:37 GMT 2018


>From the latest docs (Qt 5.10), cf. http://doc.qt.io/qt-5/qsqldatabase.html :

QSqlDatabase::QSqlDatabase(const QString &type)

The currently available driver types are:
..
QSQLITE     SQLite version 3 or above
QSQLITE2    SQLite version 2
..

So apparently, using "QSQLITE" seems to be the right thing (and "QSQLITE3" is 
not listed) ... can you explain where you have your information from?

Am Sonntag, 7. Januar 2018, 01:14:02 CET schrieb Robert Krawitz:
> It appears that at least with the latest Qt that we need to specify
> the QSQLITE3 driver; QSQLITE uses the sqlite2 driver, which crashes
> when it tries to open an sqlite3 database.
> 
> diff --git a/Exif/Database.cpp b/Exif/Database.cpp
> index 237fa931..514978c1 100644
> --- a/Exif/Database.cpp
> +++ b/Exif/Database.cpp
> @@ -115,7 +115,7 @@ static void showError( QSqlQuery& query )
>  Exif::Database::Database()
> 
>      : m_isOpen(false)
> 
>  {
> -    m_db = QSqlDatabase::addDatabase( QString::fromLatin1( "QSQLITE" ),
> QString::fromLatin1( "exif" ) ); +    m_db = QSqlDatabase::addDatabase(
> QString::fromLatin1( "QSQLITE3" ), QString::fromLatin1( "exif" ) ); }
> 
> 
> @@ -370,7 +370,7 @@ bool Exif::Database::isAvailable()
>  #ifdef QT_NO_SQL
>      return false;
>  #else
> -    return QSqlDatabase::isDriverAvailable( QString::fromLatin1( "QSQLITE"
> ) ); +    return QSqlDatabase::isDriverAvailable( QString::fromLatin1(
> "QSQLITE3" ) ); #endif
>  }







More information about the Kphotoalbum mailing list