Skip to content

Commit

Permalink
Merge branch '3.4' of https://github.com/pawelsalawa/sqlitestudio int…
Browse files Browse the repository at this point in the history
…o 3.4
  • Loading branch information
Paweł Salawa committed Jan 18, 2023
2 parents c7dd094 + dc7a47c commit 6740ae7
Show file tree
Hide file tree
Showing 40 changed files with 4,745 additions and 4,432 deletions.
191 changes: 76 additions & 115 deletions .github/workflows/sandbox_w64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
env:
QT_VERSION: '5.15.2'
SQLITE_VERSION: '3400000'
SQLITE_RELEASE_YEAR: '2022'
QT_ARCH: 'win32_mingw81'
PYTHON_VERSION: '3.9'
QT_BIN_DIR: ../Qt/5.15.2/mingw81_32/bin

name: Sandbox/playground

Expand All @@ -12,133 +17,89 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/setup-python@v2
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'

- name:
shell: bash
run: |
ls -l $pythonLocation
- name: Create python files in output dir
shell: bash
run: |
pythonPath='${{ env.pythonLocation }}'
pythonPath=${pythonPath//\\/\/}
pythonPath=${pythonPath/c:/\/c}
ver=${{ env.PYTHON_VERSION }}
7z a -r python${ver//./}.zip $pythonPath/lib/encodings
7z a python${ver//./}.zip \
$pythonPath/lib/_collections_abc.py \
$pythonPath/lib/_sitebuiltins.py \
$pythonPath/lib/abc.py \
$pythonPath/lib/codecs.py \
$pythonPath/lib/genericpath.py \
$pythonPath/lib/io.py \
$pythonPath/lib/ntpath.py \
$pythonPath/lib/os.py \
$pythonPath/lib/site.py \
$pythonPath/lib/stat.py
cp $pythonPath/python${ver//./}.dll .
cp $pythonPath/vcruntime140.dll .
- name: Upload package artifact
uses: actions/upload-artifact@v1
with:
name: win.zip
path: .
mac:
runs-on: macos-11
platform: x86

steps:
- uses: actions/setup-python@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'

- name:
shell: bash
run: |
zip --help
ls -l $pythonLocation/lib
ls -l $pythonLocation/lib/python${{ env.PYTHON_VERSION }}
path: ${{ github.workspace }}\..\Qt
key: ${{ runner.os }}-${{ env.QT_VERSION }}-Qt-Cache

- name: Create python files in output dir
shell: bash
run: |
pythonPath=${{ env.pythonLocation }}
ver=${{ env.PYTHON_VERSION }}
libDir=$pythonPath/lib/python$ver
zip -r python${ver//./}.zip \
$libDir/encodings \
$libDir/_collections_abc.py \
$libDir/_sitebuiltins.py \
$libDir/abc.py \
$libDir/codecs.py \
$libDir/genericpath.py \
$libDir/io.py \
$libDir/ntpath.py \
$libDir/os.py \
$libDir/site.py \
$libDir/stat.py \
-x "**/__pycache__/*"
cp $pythonPath/lib/libpython${{ env.PYTHON_VERSION }}.dylib .
- name: Upload package artifact
uses: actions/upload-artifact@v1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
name: mac.zip
path: .
cache: true
version: ${{ env.QT_VERSION }}
host: 'windows'
arch: ${{ env.QT_ARCH }}
# jurplel/install-qt-action has a bug due to which we cannot use ${{ github.workspace }} for the "dir" property, because it will fail.
dir: 'D:/'
setup-python: 'false'

linux:
runs-on: ubuntu-20.04

steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: 'x64'
architecture: 'x86'

- name: Clone repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}

- name:
- name: Install dependencies
shell: bash
run: |
ls -l $pythonLocation/lib
- name: Create python files in output dir
7z x -o".." win_deps/win32_deps.zip
echo "../lib" >> $GITHUB_PATH
- name: Find zlib
shell: bash
run: |
pythonPath=${{ env.pythonLocation }}
ver=${{ env.PYTHON_VERSION }}
libDir=$pythonPath/lib/python$ver
zip -r python${ver//./}.zip \
$libDir/encodings \
$libDir/_collections_abc.py \
$libDir/_sitebuiltins.py \
$libDir/abc.py \
$libDir/codecs.py \
$libDir/genericpath.py \
$libDir/io.py \
$libDir/ntpath.py \
$libDir/os.py \
$libDir/site.py \
$libDir/stat.py \
-x "**/__pycache__/*"
cp $pythonPath/lib/libpython${{ env.PYTHON_VERSION }}.so* .
- name: Create python files in output dir2
find ../../ -name "zlib.h"
- name: Install SQLite3
shell: bash
run: |
pythonPath=${{ env.pythonLocation }}
ver=${{ env.PYTHON_VERSION }}
libDir=$pythonPath/lib/python$ver
zip -r python${ver//./}.zip \
$libDir/* \
-x "**/__pycache__/*"
- name: Upload package artifact
uses: actions/upload-artifact@v1
with:
name: lin.zip
path: .
cd ..
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-amalgamation-$SQLITE_VERSION.zip --output sqlite-amalgamation-$SQLITE_VERSION.zip
7z x sqlite-amalgamation-$SQLITE_VERSION.zip
cd sqlite-amalgamation-$SQLITE_VERSION
gcc.exe sqlite3.c -Os -fpic -DWIN32 -m32 -I. -shared -o sqlite3.dll \
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
-DSQLITE_ENABLE_DBSTAT_VTAB \
-DSQLITE_ENABLE_BYTECODE_VTAB \
-DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
-DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_GEOPOLY \
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_MATH_FUNCTIONS
cp -f sqlite3.dll ../lib/
cp -f sqlite3.h ../include/
cp -f sqlite3ext.h ../include/
- name: Compile additional SQLite3 extensions
shell: bash
run: |
cd ..
mkdir ext
curl -L http://sqlite.org/$SQLITE_RELEASE_YEAR/sqlite-src-$SQLITE_VERSION.zip --output sqlite-src-$SQLITE_VERSION.zip
7z x sqlite-src-$SQLITE_VERSION.zip
cd sqlite-src-$SQLITE_VERSION/ext
FLAGS="-shared -Os -fpic -DWIN32 -m32 -Imisc -I../../include -L../../lib -lsqlite3"
for f in compress; do
echo "gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll"
gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll
done
for f in csv decimal eval ieee754 percentile rot13 series uint uuid zorder; do
echo "gcc.exe misc/$f.c $FLAGS -o ../../ext/$f.dll"
gcc.exe misc/$f.c $FLAGS -o ../../ext/$f.dll
done
ls -l ../../ext/
9 changes: 5 additions & 4 deletions .github/workflows/win32_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: egor-tensin/setup-mingw@v2
with:
platform: x86
version: 8.1.0

- name: Cache Qt
id: cache-qt
Expand Down Expand Up @@ -97,10 +98,10 @@ jobs:
7z x sqlite-src-$SQLITE_VERSION.zip
cd sqlite-src-$SQLITE_VERSION/ext
FLAGS="-shared -Os -fpic -DWIN32 -m32 -Imisc -I../../include -L../../lib -lsqlite3"
for f in compress; do
echo "gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll"
gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll
done
#for f in compress; do
# echo "gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll"
# gcc.exe misc/$f.c $FLAGS -lzlib1 -o ../../ext/$f.dll
#done
for f in csv decimal eval ieee754 percentile rot13 series uint uuid zorder; do
echo "gcc.exe misc/$f.c $FLAGS -o ../../ext/$f.dll"
gcc.exe misc/$f.c $FLAGS -o ../../ext/$f.dll
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ChangeLog

### 3.4.2
- ADDED: #4653 For dealing with small fractional numbers there is an option now to change Grid View representation of these numbers to a scientific notation - the option is in Configuration/Data Browsing.
- CHANGE: #4535 Improved current query highlighter, so it considers query on the left of the cursor as current in a more intuitive way.
- BUGFIX: #4602 Fixed editing data in table with Russian upper-case name.
- BUGFIX: #4105 Fixed Import Dialog state update when changing import source (CSV vs RegExp), which could cause inability to proceed with the import in some cases.
Expand Down Expand Up @@ -30,6 +31,7 @@
- BUGFIX: #4643 Fixed executing query with apostrophe (doubled) inside of a string literal value.
- BUGFIX: #4546 Fixed exporting results of a query that is a huge SQL statement.
- BUGFIX: #4642 Fixed crash when removing a last database from the application and then modifying contents of SQL Editor.
- BUGFIX: #4064 Fixed support for ":memory:" database.
- BUGFIX: #4254 Fixed few issues with CLI help messages.
- BUGFIX: #4639 Fixed typo.
- BUGFIX: Fixed refreshing invalid database state if edited & fixed its connection options.
Expand Down
12 changes: 6 additions & 6 deletions SQLiteStudio3/coreSQLiteStudio/services/impl/dbmanagerimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DbManagerImpl::DbManagerImpl(QObject *parent) :
DbManagerImpl::~DbManagerImpl()
{
// qDebug() << "DbManagerImpl::~DbManagerImpl()";
for (Db* db : dbList)
for (Db*& db : dbList)
{
disconnect(db, SIGNAL(disconnected()), this, SLOT(dbDisconnectedSlot()));
disconnect(db, SIGNAL(aboutToDisconnect(bool&)), this, SLOT(dbAboutToDisconnect(bool&)));
Expand Down Expand Up @@ -295,7 +295,7 @@ DbPlugin* DbManagerImpl::getPluginForDbFile(const QString& filePath)

QHash<QString,QVariant> options;
Db* probeDb = nullptr;
for (DbPlugin* plugin : dbPlugins)
for (DbPlugin*& plugin : dbPlugins)
{
probeDb = plugin->getInstance("", filePath, options);
if (probeDb)
Expand Down Expand Up @@ -400,13 +400,13 @@ void DbManagerImpl::rescanInvalidDatabasesForPlugin(DbPlugin* dbPlugin)

QUrl url;
QString errorMessages;
for (Db* invalidDb : getInvalidDatabases())
for (Db*& invalidDb : getInvalidDatabases())
{
if (invalidDb->getConnectionOptions().contains(DB_PLUGIN) && invalidDb->getConnectionOptions()[DB_PLUGIN].toString() != dbPlugin->getName())
continue;

url = QUrl::fromUserInput(invalidDb->getPath());
if (url.isLocalFile() && !QFile::exists(invalidDb->getPath()))
if (url.isLocalFile() && !QFile::exists(invalidDb->getPath()) && invalidDb->getPath() != ":memory:")
continue;

errorMessages = QString();
Expand Down Expand Up @@ -582,15 +582,15 @@ void DbManagerImpl::aboutToUnload(Plugin* plugin, PluginType* type)
DbPlugin* dbPlugin = dynamic_cast<DbPlugin*>(plugin);
dbPlugins.removeOne(dbPlugin);
QList<Db*> toRemove;
for (Db* db : dbList)
for (Db*& db : dbList)
{
if (!dbPlugin->checkIfDbServedByPlugin(db))
continue;

toRemove << db;
}

for (Db* db : toRemove)
for (Db*& db : toRemove)
{
emit dbAboutToBeUnloaded(db, dbPlugin);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ QString SqlQueryItemDelegate::displayText(const QVariant& value, const QLocale&
UNUSED(locale);

if (value.type() == QVariant::Double)
return doubleToString(value);
{
if (CFG_UI.General.UseSciFormatForDoubles.get())
return value.toString();
else
return doubleToString(value);
}

return QStyledItemDelegate::displayText(value, locale);
}
Expand Down Expand Up @@ -189,7 +194,7 @@ void SqlQueryItemDelegate::setModelDataForLineEdit(QLineEdit* editor, QAbstractI
void SqlQueryItemDelegate::setEditorDataForLineEdit(QLineEdit* le, const QModelIndex& index) const
{
QVariant value = index.data(Qt::EditRole);
if (value.userType() == QVariant::Double)
if (value.userType() == QVariant::Double && !CFG_UI.General.UseSciFormatForDoubles.get())
{
le->setText(doubleToString(value));
return;
Expand Down
Loading

0 comments on commit 6740ae7

Please sign in to comment.