Commit Graph

782 Commits

Author SHA1 Message Date
Martin Kleusberg
ba75bd16fe Use common format for all include guards and avoid leading underscores
Use a common format for all include guards, make sure each header file
has one and make sure it's named after the file name.

And as a random extra in this commit: Make sure the gen_version.h file
generated by cmake ends with a line break.

Closes #59.
2014-07-31 21:32:58 +02:00
Martin Kleusberg
5f4066c351 MainWindow: Show line numbers in SQL log 2014-07-31 21:19:41 +02:00
Justin Clift
ccfc3519f8 Remove trailing whitespace, accidentally added in previous commit 2014-07-31 09:15:15 +01:00
Justin Clift
e801a7867d Added steps for compiling single executable binary on OSX 2014-07-31 09:14:12 +01:00
mafagafogigante
262612928d some comments were corrected 2014-07-31 08:56:24 +01:00
Justin Clift
3b91636740 Update the internal OSX .app package number to 3.2.99 2014-07-27 21:11:54 +01:00
Peinthor Rene
8d9f08a74a qt5: fix qt5 cmake build 2014-07-27 21:06:56 +02:00
Peinthor Rene
f8b5c92c0b update windows cross compiling instructions
since translation files are generated now and mxe qt4 is missing
a lrelease binary, we have to use the system one
2014-07-27 20:46:35 +02:00
Martin Kleusberg
e43f43a3f8 Silence some warnings in the antlr code 2014-07-27 13:39:36 +02:00
Peinthor Rene
7a5c60b300 Merge pull request #66 from achpile/master
'%u' causes warning messages on 64bit systems.
2014-07-26 23:21:27 +02:00
Martin Kleusberg
373bd5db5b Remove \r characters from table definitions while reading DB layout
Remove all \r characters from a table defintion when reading it. This
makes sure it doesn't appear as a invalid character in the UI.

This commit improves the displaying of EoD's database from issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
2dd0e9516f Grammar: Allow multiple table keys which are not separated by commas
Fix table definitions like this...
CREATE TABLE [player_tech_branches]
(
	[from_id] INTEGER NOT NULL REFERENCES [techs](id),
	[to_id] INTEGER NOT NULL REFERENCES [techs](id),

	UNIQUE ([from_id], [to_id]) PRIMARY KEY ([from_id], [to_id])
)
...where there are multiple keys which are not separated by commas.

This partially fixed EoD's database in issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
8d23c77578 Grammar: Fix multiple primary keys with conflict clause
Fix handling of multiple primary keys followed by a conflict clause like
in thix table definition:
CREATE TABLE [explore_records]
(
	[system_id] INTEGER NOT NULL REFERENCES [star_systems](id),
	[player_id] INTEGER NOT NULL REFERENCES [players](id),
	PRIMARY KEY ([player_id], [system_id]) ON CONFLICT ABORT
)

This partially fixes EoD's problem in issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
7f007824fa Grammar: Support ON INSERT in foreign key clauses
Allow ON INSERT in foreign key clauses like this:
CREATE TABLE x
(
	y INTEGER REFERENCES ref(id) ON INSERT CASCADE
)
Note that ON INSERT is allowed by SQLite but missing in the SQLite
documentation.

This partially fixes EoD's problem in issue #63.
2014-07-26 21:41:12 +02:00
Fedosov Alexander
a17fd095d1 '%u' causes warning messages on 64bit systems. 2014-07-26 18:46:40 +04:00
Justin Clift
4cafe43525 Trivial typo fix 2014-07-21 22:36:50 +01:00
Justin Clift
815dae90e2 Removed readline dependancy of SQLite on OSX
Readline isn't needed the way we use things, and it's just an unneccesary dependency
2014-07-21 22:30:07 +01:00
Martin Kleusberg
64bcc42241 Grammar: Add 'NO' identifier
See issue #56.
2014-07-21 21:24:53 +02:00
Martin Kleusberg
b921fe58f3 Fix treatment of spaces when importing CSV files without quotes
When importing a CSV file without no quote characters no spaces were
imported. So this...
a,b b,c
...would become...
a,bb,c

Fix this by not checking for being in quote mode when not having
configured a quote char anyway.
2014-07-20 18:12:46 +02:00
Martin Kleusberg
cd9a563568 i18n: Also build qm files when compiling using cmake and Qt5
Disclaimer: This is untested but looks plausible to me...
2014-07-20 17:37:31 +02:00
Martin Kleusberg
e07067e8bb Merge pull request #57 from VanDerSam/master
I18N was improved. Translation GUI to Russian was made.
2014-07-20 17:32:07 +02:00
Sergey Muratov
87bda982c1 I18N was improved. Translation GUI to Russian was made. 2014-07-15 22:33:17 +04:00
Martin Kleusberg
13464f41d3 Fix spelling. 2014-07-12 16:26:53 +02:00
Martin Kleusberg
42a2faf411 Tests: Simplify the cmake file
Now that the dependeny to the main window is removed from the
DBBrowserDB class we can get rid of all the dialogs and widget related
stuff in the cmake file used for the unit test project. Because our
Application class depends on the main window, too, the code for the CSV
tests is changed to use Qt's standard QApplication class.
2014-07-12 16:21:08 +02:00
Martin Kleusberg
17cf2018ca Remove dependency to main window from DBBrowserDB class
Get rid of the dependency to the MainWindow class in the DBBrowserDB
class. It was only used for calling the log SQL and set database state
functions anyway. The same result can be achieved emitting Qt slots.
2014-07-12 16:13:32 +02:00
Martin Kleusberg
bc705b61f1 Fix stupid spelling mistake in the default gen_version.h file
Fix a spelling error in the include guard of the default gen_version.h
file. It didn't really matter even though this exact file is used when
building with qmake because it never gets included multiple times... but
it just looked odd to me and was a bit annoying since I noticed it :)
2014-07-11 21:35:32 +02:00
Martin Kleusberg
e7924f3739 Tests: Add unit tests for CSV import
Add a new test class for testing the import functionality. Currently
it's only covers some test cases for the CSV import.

Since the function to test here (DBBrowserDB::decodeCSV) is part of the
DBBrowserDB class, that class has a reference to the main window and the
main window basically depends on the entire rest of the project the
makefile grew quite a bit unfortunately.
2014-07-11 21:31:34 +02:00
Martin Kleusberg
ceb74a8cd4 Tests: Make sure the TestTable::parseSQLdefaultexpr() passes
Fix some issues in the parseSQLdefaultexpr unit test to make it actuall
pass.
2014-07-10 21:38:35 +02:00
Martin Kleusberg
ad392fa662 Merge pull request #47 from TheVanDoom/master
Fixed a problem with the import of .csv-files

This fixes the import of CSV files with multi-byte UTF-8 characters in them. Also handle CSV files without a trailing line break better.
2014-07-10 17:32:08 +02:00
Peinthor Rene
0df6148afe unittest: add test for literalvalue in default constraint 2014-07-10 07:30:25 +02:00
Peinthor Rene
f3a2a74953 grammar: fix missing literalvalues in default constraint 2014-07-10 07:30:05 +02:00
Peinthor Rene
6705e8c9f2 show real insert data after insert a new row
After the insert statement the inserted row
will be fetched and shown in the browse table.
2014-07-10 00:33:41 +02:00
Peinthor Rene
00ae461dff add a getRow function to retrieve rowdata by rowid 2014-07-10 00:31:45 +02:00
moritzhader
37e195ad6f Fixed a problem with the csv-import.
During the import, the parser used to append blanks between quotes and separators as part of the cell-content.
Now blanks are detected and ignored, iff they are not used as separator or in between quotes.
2014-07-09 20:29:11 +02:00
moritzhader
e86e648124 Changed the read-line command
Previously, the read-line was performed using the stream-operator. Unfortunately, this approach limited the possible reading range to a word, causing problems when parsing files with blanks between the quotes and separators.
Instead, the readline is performed using the readLine() method of the QTextStream class.
2014-07-09 19:56:22 +02:00
Moritz Hader
d8bc658df7 Fixed a problem with the import of .csv-files
Up until now, the DBBrowserDB:decodeCSV used to load the csv-file character by character using the getChar() method of the QFile-class.
Unfortunatelly, this approach caused multibyte-chars as used for UTF-8 encoding to be split and displayed incorrectly.

The fix uses the QTextStream-class to load the file line by line.
Every line is then again iterated character by character, before the old algorithm is applied. Using this approach, the characters are loaded and encoded properly. Splitting multibyte-chars is thus prevented.
2014-07-08 16:08:12 +02:00
Martin Kleusberg
a6a735ed24 Remove link to old website from Readme file
Remove the link to the old project website from the Readme file since that page just redirects to our new one anyway.
2014-07-07 18:35:51 +02:00
Martin Kleusberg
bee4320236 Add 3.2 release to readme file 2014-07-06 23:44:03 +02:00
Martin Kleusberg
a00e2b184d Announce new release 2014-07-06 23:42:41 +02:00
Peinthor Rene
14757544b7 Merge pull request #44 from justinclift/master
Added unit test compile and run instructions to BUILDING.md
2014-07-06 10:11:48 +02:00
Justin Clift
72ee0ce192 Added unit test compile and run instructions to BUILDING.md 2014-07-06 09:07:02 +01:00
Peinthor Rene
968c12ae7c cmake/unit: fix incorrect antlr include path 2014-07-06 09:45:11 +02:00
Peinthor Rene
517fc1182e cmake: avoid long lines in cmake file 2014-07-06 09:34:54 +02:00
Peinthor Rene
f2658958ce unittest: add a check for not exists 2014-07-05 15:16:16 +02:00
Martin Kleusberg
88a4caedba Fix crash when sorting one table in the Browse Tab and changing to another
Fix a crash when sorting the n-th column of a table in the Browse Tab
and then changing to a table with less than n columns.
2014-07-03 22:40:03 +02:00
Peinthor Rene
e1ea78fdda grammar: add tests for like operator and between 2014-06-25 19:20:58 +02:00
Peinthor Rene
dd85b16660 grammar: cleanup expr and fix between suffix expression 2014-06-25 19:20:40 +02:00
Martin Kleusberg
d85672511c Grammar: Fix parsing of NOT IN/GLOB/MATCH/REGEXP constraints
See issue #40.
2014-06-23 12:37:09 +02:00
Justin Clift
9fb75d181f Ensure the Homebrew version of SQLite3 is found 2014-06-23 01:05:00 +01:00
Martin Kleusberg
dca664270f MainWindow: Make it possible to cancel closing of database file
When closing the database, either by using the menu item or by closing
the window, the user is asked whether the changes he made shall be
saved or not. Add a third button to this message box which makes it
possible to cancel the action.
2014-06-20 13:03:23 +02:00