We don't use them in our code and Qt doesn't throw either, so save a
few bytes and maybe a few setjump() calls on Windows.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
We're getting a ton of them and they're mostly harmless. I've already
turned on the ones that are problematic (with -Werror even).
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Only implemented for Windows for now. On Mac, macdeployqt copies all
imageformat plugins on its own.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Unix developers, look away... this is how it's done on Windows: the
binary loader searches $PATH for the DLLs, so let's reuse the same
variable. This simplifies the command-line a little.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
On Linux distros, it seems, objdump is configured to read Windows
executables (BFD architecture "pei-i386"), so we don't need to find an
alternate / cross-compile version. But leave the code here in case we
run into a distro that does things differently.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This is probably the most complex part of the new buildsystem. This
adds the following targets:
- Linux:
make install - installs to $(prefix) (default: /usr)
The install path can be changed during make install time.
- Windows:
make install - installs Subsurface and its dependencies to
packaging/windows.
- Mac:
make mac-deploy - populates Subsurface.app with the dependencies
make install - mac-deploy + install Subsurface.app to /Application
make mac-create-dmg - mac-deploy + creates Subsurface-$VERSION.dmg
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This is working for me, but requires a bit more testing. To build,
run:
qmake [options]
Where options might be:
V=1 disable "silent" build
LIBDCDEVEL=1 use side-by-side libdivecomputer
INCLUDEPATH+=xxx add -Ixxx (e.g., INCLUDEPATH+=/usr/local/marble/include)
LIBS+=xxx add xxx to the linker flags (e.g. LIBS+=-L/usr/local/marble/lib)
or any other qmake option, including debug and release options
If your distribution is already using qtchooser in place of qmake, you
may need to pass an extra option to qmake to select the a
cross-build. For example:
qmake -qt=i686-w64-mingw32-qt4
If your distribution is not yet using qtchooser, then you need to file
a bug report requesting it and you need to run the full path to qmake.
Note:
- there are some ### left in the buildsystem
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Instead use a hash to cache the translations (and allow for the ability to
clear the hash so we can even switch translations at runtime...).
Now Qt will keep track of the memory and release it for us when we are
done with it.
This avoids the memory leak introduced in commit 4ecb35bf5ff2 ("Make a
copy of the translated text").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This doesn't enable translation switching, but at least we try and load
the correct translation at startup.
We create two global pointers for the currently active translations.
This also removes the remainders of the gettext()/glib based translation
system.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Otherwise the translation will get freed (and often reused) before it
makes it to the screen.
The problem with this is that it leaks memory for every translation.
Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This rearranges things so that all the ui-generated headers are put in
.uic and found by the buildsystem the right way<tm>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface_command_line_* are now redundant as Qt
should handle the command line argument parsing on Windows
for which these functions where mainly used and where NOP
for other OS.
main.cpp also receives a couple of small changes to use:
QCoreApplication::arguments()
to obtain the list of expanded arguments and parse those
instead.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If a temperature in Kelvin is 0, I think we can safely assume it is
not set.
Fixes#207.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
libdivecomputer doesn't give the salinity in kg/l, but in g/l and
subsurface works with g/10l. So the salinity was too big by a factor
of 1000.
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I always worry if these are worth following up on - but these seem pretty
clear and obvious to me. As far as the planner is concerned, depth is
unsigned.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There's a C++ way for it. And, for some reason, it wasn't defined on my
MinGW build:
qt-ui/profilegraphics.cpp:1006:57: error: 'MAX' was not declared in this sscope
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We needed this in Gtk version as we were using a system font to show the
stars and that was missing on some ancient Windows versions. With the Qt
version we actually draw the stars so this has become obsolete.
Suggested-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Patch enables the 'Profile on top' / 'Notes on top'
functionality in the print options dialog.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dirk's ascii_strtod was blindly copied from other GPL code and didn't do
what was the main purpose (i.e. ignore the locale and still accept the
numbers we have in our data files).
This implementation does *not* care about INF/NaN, and it does *not* try
to handle some strange conditions (overflow/underflow), and I do *not*
guarantee that it doesn't have rounding issues.
That said, for our native format, we never print odd FP numbers anyway
(since we use fixed-point integer arithmetic), and while we *do* care
about exponents for some of the odder import formats (I remember
seeing them in jdivelog output), we don't care about the crazy cases.
So rather than worry about getting the edge cases right for the max
double exponents (around +-308), it just says "screw you" and gives
you something close enough.
So what it *does* try to do is handle the actual parsing right, and
get the right answer for all the reasonable cases.
Works-For-Me(tm).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After selecting a dive or a series of dives, the "Stats" tab shows the
minimum, average and maximum stats for the selected dives. The "Depth"
section does not display the correct value for the maximum depth.
Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Removing both $(HEADERS_NEEDING_MOC:.h=.moc) and qt-ui/*.moc was a
duplication, as all files refered in $(HEADERS_NEEDING_MOC) are located
in directory qt-ui/.
Generated header files qt-ui/ui_*.h were not removed.
Avoid forking `rm' multiple times and regroup file list in a more
intuitive order.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
SAMPLE_EVENT_GASCHANGE only contains o2 part, and not the he part so
when looking at ex the gaslist for dives/test20.xml it got it realy
wrong.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Tested with the Homebrew packaging system
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>