Commit Graph

2952 Commits

Author SHA1 Message Date
Martin Kleusberg
ccae4af6d1 Fix off-by-one error 2019-06-13 16:12:47 +02:00
Martin Kleusberg
50c1f46bdb Remove outdated patch
This patch has already been applied upstream and we have already updated
our local copy in the repository.
2019-05-29 16:03:15 +02:00
Scott Furry
cf05e7a462 Centralize File Filter and Resolve End CSV Import Message
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.
2019-05-29 15:54:27 +02:00
Scott Furry
a692c06637 Add option in CMake to build against external QHexEdit library
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.
2019-05-29 15:39:46 +02:00
mgrojo
09944739cc Log transaction and savepoints statements executed by application
These statements have implications for the user, so it is better to log
them.

See #1859 and #1901
2019-05-29 15:37:23 +02:00
Karim ElDeeb
75ae701b84 Create FUNDING.yml 2019-05-26 13:22:34 +02:00
Justin Clift
7d24e931e0 Merge pull request #1911 from scottfurry/CMP0071
CMakeLists change to silence CMP0071 warning.
2019-05-26 12:17:02 +10:00
Scott Furry
3642d1dedf CMakeLists change to silence CMP0071 warning.
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.
2019-05-25 12:05:29 -06:00
mgrojo
1df647b0df Fix copy-paste-edit error in SqlExecutionArea::saveState()
The error was introduced in 59b55ac436

Indentation level also fixed.

Thanks to @scottfurry for pointing this out. See issue #1889.
2019-05-19 19:41:27 +02:00
mgrojo
512f7eeeab Save splitter sizes of the Execute SQL areas to disk under request
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.
2019-05-19 13:45:56 +02:00
mgrojo
59b55ac436 Save splitter sizes in the Execute SQL areas
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
2019-05-17 23:18:00 +02:00
Justin Clift
b041a7d044 nightlies: For win, always grab latest fileio source from sqlite.org 2019-05-13 00:25:38 +10:00
Justin Clift
786a1debc4 nightlies: For macOS, always grab latest fileio source from sqlite.org 2019-05-12 23:19:40 +10:00
mgrojo
30d0b183a5 Fix crash when opening project file
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
2019-05-12 00:15:35 +02:00
Martin Kleusberg
6bbf401abd Fix build for Qt < 5.10 2019-05-11 16:28:48 +02:00
Martin Kleusberg
e2f3186d19 Fix saving/restoring of settings in Import CSV dialog
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.
2019-05-11 16:10:31 +02:00
Martin Kleusberg
2d12330783 dbhub: Set window title of new Proxy dialog
Forgot that in the last commit.
2019-05-09 15:25:10 +02:00
Martin Kleusberg
38ece2ea42 dbhub: Add proxy configuration support
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.
2019-05-09 15:11:44 +02:00
Martin Kleusberg
4cf6cb7c2a dbhub: Set last modified date of file during initial cloning
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.
2019-05-09 13:50:39 +02:00
Martin Kleusberg
afee3ca79e Support more field separators and quote chars in the CSV import
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.
2019-05-08 23:54:06 +02:00
Martin Kleusberg
cec6b82561 Fix loading of last used settings in Import CSV dialog
Fix the loading of the last used import settings in the Import CSV
dialog when the "Other" option has been used in one of the dropdown
boxes.
2019-05-07 23:16:09 +02:00
mgrojo
c70a1fc56f Close version range to apply workaround for QTBUG-73721
It appeared in Qt version 5.12.0 and it is supposed to be fixed in 5.12.3.

See issue #1658
2019-05-07 22:52:52 +02:00
Martin Kleusberg
d1621e31b8 Fix qmake build 2019-05-07 22:17:27 +02:00
Scott Furry
f877f8a10c Resolve Github Issue #1867 - Spurious Empty Filename message.
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.
2019-05-07 22:14:13 +02:00
Scott Furry
d54b820fb2 Shadowed Variable Warnings (#1864)
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.
2019-05-07 22:09:21 +02:00
Scott Furry
800a8daf11 Normalize qhexedit.h include path
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.
2019-05-07 21:56:06 +02:00
Martin Kleusberg
c61e172afe Attempt to fix the build on some platforms - again
See issue #1879.
2019-05-07 21:53:09 +02:00
Martin Kleusberg
64a596a887 Use even less Qt containers 2019-05-06 18:50:05 +02:00
Martin Kleusberg
37aaa4c7f2 Avoid using std::regex for now
It turned out that on some platforms we still aim to support the stdlib
had not yet implemented std::regex. For this reason we want to avoid
using it for now.

In the particular use cases here it was also not the best solution. It
was faster to write using a regular expression instead of a hand coded
loop but clearly a simple loop should be more efficient here.

See issue #1873.
2019-05-05 15:35:50 +02:00
Martin Kleusberg
d87f253940 Attempt to fix build error on some platforms
See issue #1873.
2019-05-03 17:59:11 +02:00
Martin Kleusberg
16768d5474 dbhub: Respect the order of the licence list and remove "Unspecified"
Respect the suggested order of the licences as provided by the dbhub.io
server instead of sorting them alphabetically by their internal key.

Also remove the hard-coded "Unspecified" licence option because the
dbhub.io server provided its own "No licence specified" option.
2019-05-03 15:28:02 +02:00
Martin Kleusberg
5e90d90ac6 Replace all typedefs by usings
This is just a matter of code style, no functional change whatsoever.
2019-05-03 15:06:48 +02:00
Martin Kleusberg
40aff11086 Use even less Qt containers 2019-05-03 15:04:15 +02:00
Martin Kleusberg
b70e25c786 dbhub: Add a built-in certificate for read-only access to dbhub.io
This adds a built-in, default certificate which enables read-only access
to dbhub.io. This should make it easier to try out the remote features.
When trying to open the Push Database dialog, a message with more
details and all required links is displayed.
2019-05-03 13:27:07 +02:00
Martin Kleusberg
d344f396b2 Use Niels Lohmann's JSON library everywhere
We started to use Niels Lohmann's JSON library instead of the one
included in Qt for the Export JSON dialog a while ago because Qt's
implementation showed some problems. To avoid any similar issues and
because Niels' library has a much nicer API, this commit migrates all
our code to his library.
2019-05-02 20:09:24 +02:00
Martin Kleusberg
b803e3c49f Use more STL containers instead of Qt containers 2019-05-02 17:02:59 +02:00
Justin Clift
a0624b0f8f Merge pull request #1869 from demian2g/patch-1
Update sqlb_ru.ts
2019-05-02 22:47:33 +10:00
demian2g
faaa282614 Update sqlb_ru.ts
typo fix
2019-05-02 15:37:55 +03:00
Martin Kleusberg
29ca549f2f Fix updating records after changing the primary key
In the Browse Data tab updating a row after having updated its primary
key or part of it before was broken for multi-column primary keys. When
updating the value of a primary key column and then updating any part of
the row afterwards, we were still using the old value until the view was
refreshed. With this commit it is possible to immediately update the
row using the updated primary key values.

See issue #1834.
2019-05-02 14:18:16 +02:00
Martin Kleusberg
9c0b36d7b7 Speed up the loading of row data a bit
This improves the performance for loading row data with my setup by
about 10%. Incidentally, the conversion from Qt to STL containers
reduced the performance by about the same number.
2019-05-02 12:34:14 +02:00
Martin Kleusberg
e16537dd9a Use emplace_back some more 2019-05-02 12:05:27 +02:00
Martin Kleusberg
59e1edc2ba Add a primitive benchmark tool for measuring the time to fetch all rows
This adds another primitive benchmark tool which in this case helps
measuring the time required to load all remaining rows from the selected
table. When activated using the LOAD_DATA_BENCHMARK define, it opens a
message box after loading of all rows using the fetch-all-data button in
the Plot Dock is clicked.
2019-05-02 11:47:35 +02:00
Scott Furry
925eed3ef8 During GCC build, series of warning messages regarding shadowed variables were
produced. Messages would take the form:

[SQLB root]/src/sql/sqlitetypes.cpp:465:79: warning: declaration of ‘fields’ shadows a member of ‘sqlb::Table’ [-Wshadow]

and reference

[SQLB root]/src/sql/sqlitetypes.h:310:17: note: shadowed declaration is here
     FieldVector fields;

All incidents isolated to [SQLDB root]/src/sql/sqlitetypes.{h,cpp}.
Change renames local variables to silence warnings.

no errors after execution w/ gcc/clang builds on Linux.
2019-05-01 22:13:55 +02:00
Martin Kleusberg
a88fad2145 Do not print an error message when a PRAGMA did not return any value
When a PRAGMA query did not return any value (most notably the PRAGMA
foreign_key_check after editing a table using the Edit Table dialog), we
used to print an error message to the console. There were no further
side effects but the message could be irritating. This extra error
message is removed by this commit.

See issue #1868.
2019-05-01 22:10:06 +02:00
Martin Kleusberg
a1b43bca73 Use std::tolower with unsigned char only 2019-05-01 12:15:04 +02:00
Martin Kleusberg
14f91e95db Add missing include 2019-05-01 12:12:40 +02:00
Martin Kleusberg
20eb5e078e Fix a warning 2019-05-01 12:10:34 +02:00
Martin Kleusberg
0acbcce80c Fix compilation for older versions of Qt
QRandomGenerator was introduced in Qt 5.10 only.
2019-04-29 21:39:44 +02:00
Martin Kleusberg
189652d350 Remove some unnecessary includes 2019-04-29 20:54:26 +02:00
Martin Kleusberg
f821fbb1a8 Silence a couple of warnings 2019-04-29 19:14:10 +02:00