diff --git a/src/AboutDialog.ui b/src/AboutDialog.ui
index 684096a28..d5b3b0d47 100644
--- a/src/AboutDialog.ui
+++ b/src/AboutDialog.ui
@@ -80,15 +80,14 @@
0
0
635
- 349
+ 350
-
- <html><head/><body><p>DB Browser for SQLite is an open source, freeware visual tool used to create, design and edit SQLite database files.</p><p>It is bi-licensed under the Mozilla Public License Version 2, as well as the GNU General Public License Version 3 or later. You can modify or redistribute it under the conditions of these licenses.</p><p>See <a href="https://www.gnu.org/licenses/gpl.html">https://www.gnu.org/licenses/gpl.html</a> and <a href="https://www.mozilla.org/MPL/2.0/index.txt">https://www.mozilla.org/MPL/2.0/index.txt</a> for details.</p><p>For more information on this program please visit our website at: <a href="https://sqlitebrowser.org">https://sqlitebrowser.org</a></p><p><span style=" font-size:small;">This software uses the GPL/LGPL Qt Toolkit from </span><a href="https://qt-project.org/"><span style=" font-size:small;">https://qt-project.org/</span></a><span style=" font-size:small;"><br/>See </span><a href="https://doc.qt.io/qt-5/licensing.html"><span style=" font-size:small;">https://doc.qt.io/qt-5/licensing.html</span></a><span style=" font-size:small;"> for licensing terms and information.</span></p><p><span style=" font-size:small;">It also uses the Pastel SVG icon set by Michael Buckley under a Creative Commons
-Attribution Share Alike 4.0 license.<br/>See </span><a href="https://codefisher.org/pastel-svg/"><span style=" font-size:small;">https://codefisher.org/pastel-svg/</span></a><span style=" font-size:small;"> for details.</span></p></body></html>
+ <html><head/><body><p>DB Browser for SQLite is an open source, freeware visual tool used to create, design and edit SQLite database files.</p><p>It is bi-licensed under the Mozilla Public License Version 2, as well as the GNU General Public License Version 3 or later. You can modify or redistribute it under the conditions of these licenses.</p><p>See <a href="https://www.gnu.org/licenses/gpl.html"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/gpl.html</span></a> and <a href="https://www.mozilla.org/MPL/2.0/index.txt"><span style=" text-decoration: underline; color:#0000ff;">https://www.mozilla.org/MPL/2.0/index.txt</span></a> for details.</p><p>For more information on this program please visit our website at: <a href="https://sqlitebrowser.org"><span style=" text-decoration: underline; color:#0000ff;">http://sqlitebrowser.org</span></a></p><p><span style=" font-size:small;">This software uses the GPL/LGPL Qt Toolkit from </span><a href="http://qt-project.org/"><span style=" font-size:small; text-decoration: underline; color:#0000ff;">https://qt-project.org/</span></a><span style=" font-size:small;"><br/>See </span><a href="https://doc.qt.io/qt-5/licensing.html"><span style=" font-size:small; text-decoration: underline; color:#0000ff;">https://qt-project.org/doc/qt-5/licensing.html</span></a><span style=" font-size:small;"> for licensing terms and information.</span></p><p><span style=" font-size:8pt;">We use the nalgeon/sqlean library for SQLite extensions support.<br/>This library is licensed under the MIT license, see the following for more information:<br/></span><a href="https://github.com/nalgeon/sqlean"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">https://github.com/nalgeon/sqlean</span></a></p><p><span style=" font-size:small;">It also uses the Pastel SVG icon set by Michael Buckley under a Creative Commons Attribution Share Alike 4.0 license.<br/>See </span><a href="https://codefisher.org/pastel-svg/"><span style=" font-size:small; text-decoration: underline; color:#0000ff;">https://codefisher.org/pastel-svg/</span></a><span style=" font-size:small;"> for details.</span></p></body></html>
Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp
index bf55ec07f..46640c895 100644
--- a/src/PreferencesDialog.cpp
+++ b/src/PreferencesDialog.cpp
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
PreferencesDialog::PreferencesDialog(QWidget* parent, Tabs tab)
: QDialog(parent),
@@ -42,6 +43,8 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Tabs tab)
ui->checkUpdates->setVisible(false);
#endif
+ createBuiltinExtensionList();
+
loadSettings();
connect(ui->appStyleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(adjustColorsToStyle(int)));
@@ -206,6 +209,11 @@ void PreferencesDialog::loadSettings()
ui->checkCloseButtonOnTabs->setChecked(Settings::getValue("editor", "close_button_on_tabs").toBool());
ui->listExtensions->addItems(Settings::getValue("extensions", "list").toStringList());
+ for (int i=0;ilistBuiltinExtensions->count();++i)
+ {
+ QListWidgetItem* item = ui->listBuiltinExtensions->item(i);
+ item->setCheckState(Settings::getValue("extensions", "builtin").toMap().value(item->text()).toBool() ? Qt::Checked : Qt::Unchecked);
+ }
ui->checkRegexDisabled->setChecked(Settings::getValue("extensions", "disableregex").toBool());
ui->checkAllowLoadExtension->setChecked(Settings::getValue("extensions", "enable_load_extension").toBool());
fillLanguageBox();
@@ -281,6 +289,11 @@ void PreferencesDialog::saveSettings(bool accept)
Settings::setValue("extensions", "disableregex", ui->checkRegexDisabled->isChecked());
Settings::setValue("extensions", "enable_load_extension", ui->checkAllowLoadExtension->isChecked());
+ QVariantMap builtinExtList;
+ for (int i=0;ilistBuiltinExtensions->count();++i)
+ builtinExtList.insert(ui->listBuiltinExtensions->item(i)->text(), ui->listBuiltinExtensions->item(i)->checkState());
+ Settings::setValue("extensions", "builtin", QVariant::fromValue(builtinExtList));
+
// Save remote settings
Settings::setValue("remote", "active", ui->checkUseRemotes->isChecked());
QStringList old_client_certs = Settings::getValue("remote", "client_certificates").toStringList();
@@ -434,6 +447,62 @@ void PreferencesDialog::removeExtension()
ui->listExtensions->takeItem(ui->listExtensions->currentIndex().row());
}
+void PreferencesDialog::createBuiltinExtensionList()
+{
+ QDir dir;
+ QStringList files;
+
+ // If we upgrade Qt framework version to 6.x at some point, use 'macos' instead of 'osx.'
+ // For further information, see the https://doc.qt.io/qt-6/qsysinfo.html
+ if (QSysInfo::productType() == "osx") {
+ dir.setPath(qApp->applicationDirPath() + "/../Extensions/");
+ files = dir.entryList(QStringList() << "*.dylib", QDir::Files);
+ }
+ else if (QSysInfo::productType() == "windows") {
+ dir.setPath(qApp->applicationDirPath() + "/extensions/");
+ files = dir.entryList(QStringList() << "*.dll", QDir::Files);
+ }
+ else {
+ const QString productType (QSysInfo::productType());
+ const QString cpuArchitecture (QSysInfo::currentCpuArchitecture());
+ if (productType == "fedora" || productType == "redhat") {
+ if (cpuArchitecture.contains("64"))
+ dir.setPath("/usr/lib64/");
+ else
+ dir.setPath("/usr/lib/");
+ } else {
+ if (cpuArchitecture == "arm") {
+ dir.setPath("/usr/lib/aarch-linux-gnu/");
+ } else if (cpuArchitecture == "arm64") {
+ dir.setPath("/usr/lib/aarch64-linux-gnu/");
+ } else if (cpuArchitecture == "i386") {
+ dir.setPath("/usr/lib/i386-linux-gnu/");
+ } else if (cpuArchitecture == "x86_64") {
+ dir.setPath("/usr/lib/x86_64-linux-gnu/");
+ } else {
+ dir.setPath("/usr/lib/");
+ }
+ }
+ // There is no single naming convention for SQLite extension libraries,
+ // but this gives good results, at least on Debian based systems.
+ // The patterns have to exclude "libsqlite3.so", which is the SQLite3
+ // library, not an extension.
+ files = dir.entryList(QStringList()
+ << "libsqlite3[!.]*.so"
+ << "mod_*.so"
+ << "lib?*sqlite*.so", QDir::Files);
+ }
+
+ for (const QString& file: files) {
+ QString absoluteFilePath = dir.absoluteFilePath(file);
+ QListWidgetItem* item = new QListWidgetItem(absoluteFilePath, ui->listBuiltinExtensions);
+ item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
+ // The check state is redetermined after the 'loadSettings()' function call.
+ item->setCheckState(Qt::Unchecked);
+ ui->listBuiltinExtensions->addItem(item);
+ }
+}
+
void PreferencesDialog::fillLanguageBox()
{
QDir translationsDir(QCoreApplication::applicationDirPath() + "/translations",
diff --git a/src/PreferencesDialog.h b/src/PreferencesDialog.h
index 45c0001b9..b42e8935a 100644
--- a/src/PreferencesDialog.h
+++ b/src/PreferencesDialog.h
@@ -39,6 +39,7 @@ private slots:
void chooseLocation();
void showColourDialog(QTreeWidgetItem* item, int column);
void addExtension();
+ void createBuiltinExtensionList();
void removeExtension();
void activateRemoteTab(bool active);
void addClientCertificate();
diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui
index 8a8e42c15..2a5cb785e 100644
--- a/src/PreferencesDialog.ui
+++ b/src/PreferencesDialog.ui
@@ -1846,6 +1846,20 @@ Can be set to 0 for disabling completion.
+ -
+
+
+ Select built-in extensions to load for every database:
+
+
+
+ -
+
+
+ true
+
+
+
-
diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp
index 6407d800d..342ab93e4 100644
--- a/src/sqlitedb.cpp
+++ b/src/sqlitedb.cpp
@@ -2167,6 +2167,16 @@ void DBBrowserDB::loadExtensionsFromSettings()
if(loadExtension(ext) == false)
QMessageBox::warning(nullptr, QApplication::applicationName(), tr("Error loading extension: %1").arg(lastError()));
}
+
+ const QVariantMap builtinList = Settings::getValue("extensions", "builtin").toMap();
+ for(const QString& ext : builtinList.keys())
+ {
+ if(builtinList.value(ext).toBool())
+ {
+ if(loadExtension(ext) == false)
+ QMessageBox::warning(nullptr, QApplication::applicationName(), tr("Error loading built-in extension: %1").arg(lastError()));
+ }
+ }
}
std::vector> DBBrowserDB::queryColumnInformation(const std::string& schema_name, const std::string& object_name) const