Commit graph

10283 commits

Author SHA1 Message Date
Dirk Hohndel
308b69359d QMLManager: fix order of initialization
Just avoids warnings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:35 -08:00
Dirk Hohndel
af2a90b536 QML UI: remove incorrect calculation of devicePixelRatio
That's just bogus.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-08 20:50:29 -08:00
Dirk Hohndel
c6c3967dd9 Fix include file ordering problem
Otherwise dc_serial_qt_open() is not declared.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 17:18:10 -08:00
Tomaz Canabrava
9d4429c212 Silence warnings in SettingsObjectWrapper.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:45:16 -08:00
Tomaz Canabrava
e64f13104d Silence warnings in save-git.c
Also, another unused function removed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:44:50 -08:00
Tomaz Canabrava
a86a2e52c6 Silence warnings in planner.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:44:12 -08:00
Tomaz Canabrava
91ee285d93 Silence warnings in deco.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:43:57 -08:00
Tomaz Canabrava
f81dd80a48 Silence warnings in cochran.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:43:43 -08:00
Tomaz Canabrava
19b4477cd9 Silence warnings in libdivecomputer.c
There was also a function not being used that could be safely removed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:56 -08:00
Tomaz Canabrava
2258939566 Silence warnings in parse-xml.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:30 -08:00
Tomaz Canabrava
b77c1d0d95 Silence warnings in load-git.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:42:26 -08:00
Tomaz Canabrava
3b782da960 Silence warnings in liquivision.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:34:17 -08:00
Tomaz Canabrava
62bdc9e3ec Silence warnings in git-access.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:32:41 -08:00
Tomaz Canabrava
9d3be5a165 Silence warnings in gaspressures.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 16:32:18 -08:00
Tomaz Canabrava
04e39704e2 Fix annoyances on file.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:24:10 -08:00
Tomaz Canabrava
beb0bc7a1d Silence more warnings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:23:27 -08:00
Tomaz Canabrava
d7d8660bbb Clean up more unused variables
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:21:44 -08:00
Tomaz Canabrava
5bf0e48700 Remove unused variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:17:16 -08:00
Tomaz Canabrava
726e251ffc Simplify Q_FOREACH
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:16:44 -08:00
Tomaz Canabrava
3a003cb4fa Silence warnings for the GpsLocation
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:13:11 -08:00
Tomaz Canabrava
f25dce8511 Create a constructor with default parameters for some structs
Structs and classes in C++ are basically the same thing and we want to
create a few zero-initialized values for some of them; Sadly, C++ doesn't
have the nice static struct initialization that C has.

One way to deal with that is to create a constructor and pass default
values to it, another is lambda-initialization, but we don't use C++11,
yet.

Since we initializate stuff on the constructor, we don't need to
re-initializate things again on the initialization list (which is also why
I removed the QStrings from the initialization lists, they are
automatically initialized to empty)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:13:11 -08:00
Tomaz Canabrava
2745beca5f Silence warning about unused parameter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:00:27 -08:00
Dirk Hohndel
1e8b0874ab iOS build: show correct program name on launch screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 19:35:37 -08:00
Dirk Hohndel
8a96f6e90b iOS build: bundle application icons and Info.plist
This way the iDevice will show the correct name and icon for
Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 17:51:09 -08:00
Dirk Hohndel
ba8014eb5c iOS build: restructure build.sh to create fat libraries
This way QtCreator can successfully link and deploy the app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 17:49:35 -08:00
Dirk Hohndel
7ae4eed734 iOS build: more build.sh hacking
This now can create all the support libraries in armv7, but that isn't
sufficient for QtCreator which wants fat libraries with both armv7 and arm64 in
them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 15:11:49 -08:00
Dirk Hohndel
8a6728eb08 Revert "iOS build: add the pri file for generating the version"
This reverts commit 7fac2a38b2.

Oops, that should have been dropped in the rebase before pushing the
changes. I did this instead in commit 99d1d8876e ("iOS build: create
ssrf-version.h by hand")
2016-03-06 11:13:04 -08:00
Dirk Hohndel
99d1d8876e iOS build: create ssrf-version.h by hand
It grabs the mobile version from the cmake file via grep.
🤦

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:11 -08:00
Tomaz Canabrava
7fac2a38b2 iOS build: add the pri file for generating the version
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:11 -08:00
Dirk Hohndel
8d9bffff64 iOS build: fix libdivecomputer build
This uses new configure options added to the Subsurface-branch of
libdivecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:11 -08:00
Tomaz Canabrava
c27a2b47f4 iOS build: fix loading icons
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:00 -08:00
Tomaz Canabrava
933b69a7cc qt-gui.h shouldn't include QApplication
[Dirk Hohndel: refactored the iOS patches]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:00 -08:00
Tomaz Canabrava
997ee6fb40 iOS build: don't include CoreServices on iOS
[Dirk Hohndel: refactored the iOS patches]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:00 -08:00
Tomaz Canabrava
39313c5b33 Clean up handling of various include file
This is in the context of the iOS port and shouldn't impact any of the
other builds.

[Dirk Hohndel: refactored the iOS patches]

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:03:00 -08:00
Tomaz Canabrava
710b3615fe iOS build: add various support files
It's unclear why the build fails if we don't add the sample app files as
well.

[Dirk Hohndel: refactored the patches]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:02:48 -08:00
Tomaz Canabrava
74e6e0ed37 iOS build: Updated build script
This now only builds all the prerequisits but not the actual Subsurface
binaries - that will be done with qmake (oh the irony) in a later commit.

[Dirk Hohndel: refactored the patches]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-06 11:02:31 -08:00
Dirk Hohndel
e9e453b009 Android build: pass in build nr
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 21:23:27 -08:00
Dirk Hohndel
a64eef7f82 Android build: automate setting the right version number
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 17:14:33 -08:00
Dirk Hohndel
d42b7f55c4 Introduce separate version number for Subsurface-mobile
This is hard coded in version.cmake for now. The intent is to go to 1.0 in
the first release version and to increment from there whenever we create
an update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 17:00:14 -08:00
Dirk Hohndel
5aa94578f7 QML UI: small modification to About screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-05 17:00:14 -08:00
Dirk Hohndel
04f3a6f8d5 Rewrite the Subsurface-mobile user manual
This brings the text closer to the current version of Subsurface-mobile,
but a lot more fine tuning will be required (and of course the images need
to be updated to reflect the current UI).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-04 11:38:01 -08:00
Linus Torvalds
afadb6f05c gas model: use virial cubic polynomial form
The "virial" form of the Z compression factor is of the form

   Z = 1.0 + A*p + B*p^2 + C*p^3 + ..

and it's considered the "right" polynomial form to use.  It happens to
also make for one constant less per gas (since the 1.0 can be added
later), and can be used to simplify the expression and avoid a few
floating point operations.

However, in order for that kind of expression simplification to make
sense, we need to make sure that we don't calculate the powers of the
pressure multiple times either, and that means we have to inline all the
actual calculations.

Our compiler options still mean that the generated code isn't optimal,
but that's a separate issue. And it is a lot better than it used to be.

Being clever about this does potentially make the code a tiny bit less
legible, but maybe that's not too bad for something that we'd expect to
not ever touch once we get it right.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-04 10:18:07 -08:00
Dirk Hohndel
a873711cec QML UI: make sure the drawer is closed after going back to dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 15:12:09 -08:00
Dirk Hohndel
80f29bd3f6 QML UI: brute force around Qt 5.6.0 bug
With the current release candidate of Qt 5.6.0 we get into an infinite
recursion of the grid layout engine. This had happened before (prior to the 5.6
beta) and it appeared that setting the maximum width of the columns was
sufficient to fix this. But with the RC even that isn't sufficient, so now we
give up on having QML figure out the best possible column width and hard code
both preferred and maximum width to the same, predefined values. That's a total
shame, but at least now we can build against Qt 5.6 without infinite recursions
and crashes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:36:57 -08:00
Dirk Hohndel
0cad6d206c QML UI: remove commented out / unused code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:35:54 -08:00
Dirk Hohndel
2b1812f2cb Build scripts: work with both Qt 5.5 and 5.6
This is all a bit hackish but seems to work

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:34:03 -08:00
Dirk Hohndel
01ae4af13d Don't access undefined dive
When walking the dive table we need to stop before accessing the
yet-to-be-added new dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:29:29 -08:00
Dirk Hohndel
bf798390fa Avoid dangling else warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:29:19 -08:00
Linus Torvalds
a173a3ce79 gas model: simplify and improve our Z factor calculations
Lubomir found better compressibility data for the pure gases that we
need for scuba, making the air table superfluous: we get good values
from just regular linear mixing of the Oxygen, Nitrogen and Helium
calculations.

Also, rather than using a quintic polynomial, a cubic one does
sufficiently well, making for smaller code and fewer coefficients.

And judging by the reactions from people on G+ (as well as just looking
at how good the fit is with the air data), this is all the right way to
do this, and this thus removes the Redlich-Kwong equation.

All-credit-goes-to: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 14:19:45 -08:00
Dirk Hohndel
12f36c92e1 QML UI: try to avoid binding loop
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-03 10:51:52 -08:00