Fix crash when cancelling 'Add Dive'

If selected_dive is -1 get_dive(selected_dive) will return NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge http://github.com/thiagomacieira/subsurface
Disable unused function

I am not removing this but leaving it around as this is useful for a
feature that we still need to enable - the ability to filter out which
events to display. This existed in 3.1 but is missing in the Qt version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix potential uninitialized variable

Most of the "possibly unitialized" warnings are bogus, but this one is a
potential real bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove unnecessary moc include

This fixes compilation issues with the new build system.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
windows.c: use the USERNAME enviroment variable

system_default_filename():
Use USERNAME, which should work for Windows XP and above.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only define TRUE and FALSE if they aren't defined already

We did this for some situations but not for all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Link static to libdivecomputer

In previous build system we linked static to libdivecomputer, so start
doing that again.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turn down warnings (after going through them)

This was getting way too noisy with tons of false positives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turn down warnings with Clang too

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small fixes to the build notes for Mac

Use the correct git tree for libdivecomputer.
Only build libmarble, not all of marble
Don't try make install for libmarble - it's bogus
Copy the correct marble headers
Only use sudo to write into /Applications

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't set -Wno-maybe-uninitialized for clang

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correct Mac bundle path

Should be /Applications (plural)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now bundle install on the Mac works without sudo

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface-configure.pri: pkg-config detection change

This is a small change, but it seems to work as expected on both
Linux and Win32. What happens if 2> NUL > NUL is used on Win32
for cmd.exe is that the output of both stdout and stderr seems
to pipe into NUL and pkg-config is always reported as missing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface-configure.pri: enable the libusb detection stage

The commented out step should work as expected (in theory).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface-configure.pri: add another libxml/libxslt detection stage

libxml and libxslt use custom -config scripts which brake
qmake and make on Win32. The output of executing a .sh or .cmd
script with the same name produces garbled output. The output
of executables with the same name is untested, but a bit excessive
as a solution.

To work around the issue add another detection stage, which checks
if the previous output from (e.g.) xml2-config is empty and try
to use pkg-config instead.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface-configure.pri: add a libiconv dependency

This is a bit crude of a solution, but the Win32 version
of libxml (or at least some versions) seem to require libiconv,
thus we add the library with pkg-config if it is available.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Try hard not to link against a shared libdivecomputer

Versioning is wrong. It's not a library shared with other projects. And at
least on Mac and Windows we bundle it with the app, anyway.

Requested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already try to link against libusb anyway

No need for the special case here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>