Fix a crash when using the "Browse Table" action in the right click menu
in the Database Structure tab. It crashed whenever the table name or the
schema name started or ended with a space character.
When detecting the data type in the Edit Cell dialog, don't treat
simple numbers as a JSON document. They should be handled as text
instead.
Thanks to @mgrojo for pointing this out here.
d344f396b2 (r34132706)
A second Ctrl+Click over an already added column changes the direction of
any column.
Before this change, the effect was only applied to the last selected column
and a second Ctrl+Click on the other columns triggered a requery without
having changed anything.
This was mentioned in PR #1810. See also issue #1761.
Qt's isRightToLeft() returns true only for all left-to-right characters
in the string. That prevents the automatic switch to LTR Text mode, when
the text contains one or more left-to-right characters.
See #1793 and #1929
This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2abfd
QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.
RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.
All these changes can be undone if a new QScintilla editor supports RTL
texts.
See comments in issue #1793
Always send the fetched() signal when a RowLoader thread has finished a
fetch task. Before this the signal was only sent when some data was
actually retrieved from the task. This fixes some rare problems in the
Execute SQL tab where the query for determining the row count of a
SELECT statement changes something, so the subsequent row loading task
does not return any rows after all.
The only case I know of is when loading an extension using the
'SELECT load_extension()' function. The load_extension function is
actually called twice when SQLite for some reason reports that rows
where returned from this statement. These calls are:
SELECT COUNT(*) FROM (SELECT load_extension('...'));
SELECT load_extension('...');
After the first call is executed, the extension is loaded. So the second
call does not return any rows and we indefinitely wait for the rows we
expect. Strangely enough this only happens for some extensions.
The change here should have no side effects becaue the signal is only
connected to one slot which skips most steps when no rows where fetched.
See issue #1932.
Instead of registering the error log callback function every time a
database file is opened, we now register it only once when the
application is first started. This way we can avoid calling
sqlite_shutdown which can have unintended side effects.
See issue #1932.
While testing the original database from issue #1892 which contains
hundreds of tables and fields, I noticed how long the loading of the
database structure takes. This is especially problematic since it needs
to be reloaded on various occasions, e.g. running most statements in the
Execute SQL tab, which stalls the application every time.
According to a profiler it is the QIcon constructor which requires most
of the time. By introducing this small icon cache class we can reduce
the time for loading icons to almost nothing.
While still not perfect the UI already feels much more responsive with
this patch.
Windows build script will now save, and check, the last build commit and
skip building if there are no new commits since the last automatic build.
See #1917.
Matter came up WRT #1880. In reviewing, several other instances
were found where same file filter as a string literal was repreated.
This commit centralizes these file filters to one location. Filters
are declared `static const` to prevent accidental modification.
Also applied is a fix to #1881. QMessage at end of Import CSV is removed.
From upstream source, QHexEdit is intended to be a modular widget
for Qt5. (README @ https://github.com/Simsys/qhexedit2)
Add ability for platforms that already have QHexEdit installed to
build DB4S against installed (external to DB4S) QHexEdit library.
Current version of library available is consistent with version
contained in DB4S project `libs` folder.
(see https://repology.org/project/qhexedit2/versions)
Default of CMake flag FORCE_INTERNAL_QHEXEDIT is ON (enabled) so
as to minimize impact to current development workflow and other
platforms. Using flag is left as an option to package managers.
Problem identified in Github Issue #1910.
Update to CMake had policy warning of AUTOMOC usage.
See https://cmake.org/cmake/help/latest/policy/CMP0071.html
Commit adds instructions to silence the warning.
Affect of AUTOMOC behaviour with 'new' needs further study.
Saving cannot be done in the class destructor, since it seems that the
sizes have already change in that moment. Now they are saved under request
of the Main Window at the same time when the Main Window state is saved.
See issue #1889.
Whenever the splitters between the SQL editor, the table result and the
last execution results panes are moved, the sizes are saved to memory (for
performance) so the next SQL tab to be opened restores them. When an area
is destroyed the last saved settings are saved to disk, so they are ready
for the next execution without much impact in disk utilisation.
Issue #1889
When opening a project file the following exception is raised in
src/sqlitedb.h:208
terminate called after throwing an instance of 'std::out_of_range'
what(): map::at
This is related to 64a596a887
Saving and restoring of quote and separator characters did not work as
expected in the Import CSV dialog since the last commits. A missing
"else" made us try to save the string "Other" as the quote character
when a custom quote character was selected. Also the translation from
and to the saved format on disk had its problems.
See issue #1860.
This adds a new dialog, accessible from the Remote tab in the Preferences
Dialog, which allows the user to configure the proxy to use for all
network connections.
The new default is to use the system-wide proxy settings.
See issue #979.
The dbhub.io server provides us the last modified date of the database
when cloning it. Because we send the last modified date back to the
server when trying to push a database, it makes sense to initially set
the last modified date of the local file to the date provided by the
server.
See issue https://github.com/sqlitebrowser/dbhub.io/issues/101.
This adds support for more characters as field separator and for quoting
in the CSV import. Before this we only supported ASCII characters, with
this we support all characters which when UTF-8 encoded require up to
16 bits.
See issue #1860.
Problem traced to QFile::exist() producing message when passed an empty QString.
Fix is to test QString length before any QFile::exist() usage with that string.
Compile with ALL_WARNINGS using GCC 8.2.1.
Encountered approximately dozen warnings with this pattern:
[path to sqlitebrowser root]/src/[somesourcefile]:line:cursor: warning: declaration
of ‘data’ shadows a member of ‘ClassName’ [-Wshadow]
OtherDataType data = ....line of code at line given above...
^~~~
In file included from /usr/include/qt5/QtWidgets/qdialog.h:44,
from /usr/include/qt5/QtWidgets/QDialog:1,
...other sources in project
/usr/include/qt5/QtWidgets/qwidget.h:733:18: note: shadowed declaration is here
QWidgetData *data;
^~~~
It appears there is a variable named 'data' within Qt global scope. Using 'data`
as a variable name, even one limited in scope to small lamda expressions, causes
compiler some grief.
Commit resolves the warnings in affected files. No problems apparent during execution.
Requires CSV stress-testing.
Include path used for QHexEdit in EditDialog.cpp is "implementation specific"
to how DB4S uses the QHexEdit library. Change is to make usage of library
more generic.