Commit Graph

2106 Commits

Author SHA1 Message Date
Martin Kleusberg
fae7235548 Fix regression introduced by 1ca92cdde3
Turns out this doesn work as expected. So we have to convert the
QVariant to int and then case it to char instead.
2017-11-02 22:39:31 +01:00
Martin Kleusberg
69dc78da3a Fix regression introduced in 955848f957
This fixes a regression which recently was introduced by commit
955848f957. Because the status message was
overwritten by a version without the returned row count, you would never
see the intended status message when running SELECT statements in the
Execute SQL tab.

See issue #1211.
2017-11-02 22:24:55 +01:00
mgr
3a0e29cf28 Fixed incorrect display of SQL calltips containing non-US-ASCII characters.
QScintilla was incorrectly converting the text of the calltips to Latin1
although the encoding was set to UTF-8.

This fixes #1107 (Russian) and  #1206 (Korean).
2017-11-01 20:19:00 +01:00
mgr
c017a2d800 Add support for the special case for empty strings (issue #1189) in the "Use as Filter" option. 2017-11-01 13:25:10 +01:00
Martin Kleusberg
0bc430bfad Show the build date of the nightlies in the About dialog 2017-10-31 18:21:58 +01:00
Martin Kleusberg
3fe181bba7 Explicitly specify the plugins directory on Windows systems
Not sure if this is necessary because the documentation says that it is
automatically added but it's worth a try.

See issue #1188.
2017-10-31 17:58:25 +01:00
Martin Kleusberg
7e0bca5ce3 Add support for filtering for empty strings in Browse Data tab
Add special filters "=''" and "<>''" to the filter row in the Browse
Data tab for filtering for empty string and non-empty-string fields. The
latter also excludes all NULL fields because that's how SQLite works.

See issue #1189.
2017-10-31 13:52:21 +01:00
Martin Kleusberg
2545058111 Support renaming table to a name that's only differs in case
SQLite doesn't support this by itself, so we have to work around it.

See issue #1200.
2017-10-31 13:35:18 +01:00
Martin Kleusberg
87c0476d1c Introduce helper function for generating unique temporary table names 2017-10-31 13:06:27 +01:00
Martin Kleusberg
8ad34abb06 Simplify code 2017-10-31 12:14:29 +01:00
Martin Kleusberg
8b5eb417da Replace Q_NULLPTR by nullptr 2017-10-31 12:12:18 +01:00
Martin Kleusberg
5a14e47419 Mark some more constructors as explicit 2017-10-31 12:11:03 +01:00
Martin Kleusberg
ee32b3e4e1 Use nullptr where possible 2017-10-30 21:20:02 +01:00
Martin Kleusberg
6afcaf6c1f travis: Further reduce download size 2017-10-30 14:13:29 +01:00
Martin Kleusberg
1ca92cdde3 Use our Settings class everywhere
Don't use the QSettings class directly. This keeps the code more
consistent and makes it a bit easier to read. It also means that all
parts of the code profit from the settings cache that we have
implemented in the Settings class.
2017-10-30 13:37:34 +01:00
Martin Kleusberg
9f17176bf6 Simplify code
Does anybody know why this was the way it was?
2017-10-30 13:19:52 +01:00
Martin Kleusberg
3a70b412e8 Turn some slots into normal functions
They aren't used for signal processing at the moment and don't look like
they can be used for that easily.
2017-10-30 13:15:43 +01:00
Martin Kleusberg
7c1ff86900 Fix usage of 'emit' macro
Even though it doesn't expand to anything...
2017-10-30 13:12:28 +01:00
Martin Kleusberg
3bd2dc3bc1 Replace 'foreach' by range-based for loop from C++11 2017-10-30 13:10:08 +01:00
Martin Kleusberg
ac70855ee0 travis: Reduce download size prior to build
This should hopefully build just like before but reduce the number of
packages download when setting up the build environment. This way we
should get our Travis results faster and reduce the number of falsely
reported build errors, too.
2017-10-29 15:59:49 +01:00
Martin Kleusberg
9b309402db Better BLOB detection in the Browse Data tab
This improves the BLOB detection in the Browse Data tab which was
working pretty poorly because it was only looking for null bytes, not
for any other non-printable characters.

See issue #1201.
2017-10-29 13:39:24 +01:00
Martin Kleusberg
557ef399bb Rename "Not null" column to "NN" in Edit Table dialog
The "Not null" text didn't fit in the column width anyway and this makes
it more consistent with the other constraint columns.

See issue #1184.
2017-10-29 13:14:09 +01:00
Martin Kleusberg
4a386dd6a3 Add missing include 2017-10-29 11:37:58 +01:00
Martin Kleusberg
56630a20e5 Don't use system locale when parsing SQL statements
Antlr uses the current system locale when parsing SQL statements. This
is problematic because SQL is case-independent and for converting
characters to lower/upper case it is going to use the locale. For
Turkish however this adds implicit conversions between the dotted and
dotless I which triggers another problem in Antlr: it doesn't cover the
whole Unicode character set. This commit fixes the implicit conversions.

See issue #1194.
2017-10-27 18:42:43 +02:00
Martin Kleusberg
18b781495c Simplify code 2017-10-27 18:36:39 +02:00
Martin Kleusberg
955848f957 Improve detection of query vs. modify statements in Execute SQL tab
This should improve the detection of read-only query statements vs.
modifiying statements in the Execute SQL tab. The idea is to stop
looking for the SELECT keyword at the beginning of the statement and
instead fully rely on whether SQLite returns any data for this
statement.

See issue #1185.
2017-10-27 18:36:39 +02:00
Martin Kleusberg
b9595b9b7e Remove the valid flag from the SqliteTableModel class
Remove the valid flag from the SqliteTableModel class and remove its
usage in the Execute SQL tab of the main window. I believe this hasn't
been used for some time now because the main sources of error should
really be noticed before the query is even handed over to the model.
Additionally the valid flag wasn't as realible either anymore because of
the multi-threaded execution of the model queries.
2017-10-27 18:36:39 +02:00
mgrojo
9fd4ebe0e0 Fixed crashed when editing the display format and the currently browsed table name is actually a view.
Now it is checked the object type before the cast. This avoids the crash and the field name is obtained for each case.
2017-10-27 11:50:38 +02:00
Martin Kleusberg
c69314f566 Fix ampersand not showing up in dialog when renaming SQL tabs
This didn't work on Windows as pointed out by Chris Locke.
2017-10-27 11:30:59 +02:00
Martin Kleusberg
66fa44497d Try to fix build on Windows
See issue #1193.
2017-10-26 23:24:04 +02:00
m4rt1nq
ae0da5fdce Fix ‘size_t’ does not name a type compile error 2017-10-24 12:30:12 +01:00
mgrojo
c5fff20fb8 Spanish translation reviewed and updated (#1190) 2017-10-23 16:47:45 +01:00
Martin Kleusberg
04e8119049 Add basic function for cancelling queries
This doesn't do all the work yet and isn't called anywhere. So don't
expect this to do anything useful.
2017-10-22 18:34:33 +02:00
Martin Kleusberg
d126e86e81 Make sure to not re-run the query if the filters haven't changed
When changing between the filter line edits in the Browse Data tab, make
sure to only re-run the SQL query if the value of the filter line edits
have actually changed.

See issue #1187.
2017-10-22 18:29:54 +02:00
Martin Kleusberg
bc91126b2c Allow renaming SQL tabs by double clicking them
See issue #1186.
2017-10-22 14:08:52 +02:00
mgrojo
5cef432159 New option in the context menu for using the value as filter (#1182)
* Added an option in the context menu for using the currently selected cell
as filter in this column. This allows quick filtering by selected values.

* Changes to pull request #1182 requested by @MKleusberg: get internal cell data and check for the NULL special case.
2017-10-21 22:24:43 +02:00
Martin Kleusberg
37e5b62842 Make code easier to read 2017-10-20 17:47:04 +02:00
Martin Kleusberg
9cff69f534 Better error messages
Show better error message in some cirsumstances. This is most notable
when dropping a (database) file onto the structure tree view when no
database file is opened.
2017-10-20 17:13:34 +02:00
Martin Kleusberg
92a868132b More fine-grained locking
See issue #1178.
2017-10-20 15:37:55 +02:00
Martin Kleusberg
fd97cdef45 Try fixing deadlock
See issue #1178.
2017-10-19 15:46:44 +02:00
Martin Kleusberg
61d9fef7eb Don't override built-in collations
Don't ask the user whether to load a collation function if the requested
collation is already built into SQLite. Also, never override the
built-in functions.

See issue #1172.
2017-10-19 15:12:06 +02:00
Martin Kleusberg
4ae601dafd Fix default collation for UTF16 strings
Fix our default collation which we install when an unknown collation is
requested to (more or less) support UTF16 strings as well. Before this
UTF16 strings wouldn't compare correctly because they might contain null
bytes which would lead to only the first (few) byte(s) getting compared.

See issue #1172.
2017-10-19 14:54:30 +02:00
Martin Kleusberg
32da4de94d Fix collate warning after addition of multi-threaded loading
The no collate function warning is triggered in a thread which is used
for loading data. However, the warning is a message box and GUI elements
can only be drawn in the main thread. So the old code would crash. This
is fixed here by jumping to the main thread for showing the message box.
2017-10-16 21:58:30 +02:00
Martin Kleusberg
681456733e Improve locking in SQLiteTableModel 2017-10-16 21:54:33 +02:00
Martin Kleusberg
973f97c1eb Move row count query into a separate thread
In the SqliteTableModel class we need to know the total number of rows
in the table or returned by the query. This takes a considerable amount
of time and can be moved into a separate thread. I haven't done any
performance measurements with this but it might speed up switching
between large tables a bit.
2017-10-15 11:46:47 +02:00
Martin Kleusberg
3ae4267a8b Fix column widths in Execute SQL tab after multi-threading
This fixes the automatic column width adjustment in the Execute SQL tab
results view. This was broken by the introduction of multi-threaded
loading of the table data.
2017-10-15 11:39:55 +02:00
Geoff Lawrence
65454d02f3 Merge pull request #1171 from Armour/patch-1
Update README.md
2017-10-15 07:09:02 +01:00
Chong Guo
5aaf4ab1e5 Update README.md 2017-10-14 21:22:22 -07:00
Martin Kleusberg
f60c059b87 Fix horizontal tiling in Execute SQL tab
See issue #380.
2017-10-13 10:40:31 +02:00
Martin Kleusberg
3c1c6af18b Fix crash on Windows
See issue #1169.
2017-10-12 17:44:52 +02:00