Show SQLite and SQLCipher version in About dialog when using SQLCipher

See issue #1474.
This commit is contained in:
Martin Kleusberg
2018-08-10 19:09:12 +02:00
parent a1c982c158
commit b28d0f63ec
3 changed files with 38 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include "sqlite.h"
#include "sqlitedb.h"
#include "Application.h"
AboutDialog::AboutDialog(QWidget *parent) :
@@ -11,13 +11,16 @@ AboutDialog::AboutDialog(QWidget *parent) :
this->setFixedSize(this->width(), this->height());
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
QString sqlite_version, sqlcipher_version;
DBBrowserDB::getSqliteVersion(sqlite_version, sqlcipher_version);
if(sqlcipher_version.isNull())
sqlite_version = tr("SQLite Version ") + sqlite_version;
else
sqlite_version = tr("SQLCipher Version ") + sqlcipher_version + tr(" (based on SQLite %1)").arg(sqlite_version);
ui->label_version->setText(tr("Version ") + Application::versionString() + "\n\n" +
tr("Qt Version ") + QT_VERSION_STR + "\n\n" +
#ifdef ENABLE_SQLCIPHER
tr("SQLCipher based on SQLite Version ") + SQLITE_VERSION
#else
tr("SQLite Version ") + SQLITE_VERSION
#endif
sqlite_version
);
}