summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-10-09Make sure we handle untranslated Subsurface correctlyGravatar Dirk Hohndel
At least on the Mac we otherwise switch to the next language which is not what the user likely intended. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Try to read the libdivecomputer.la file (created by GNU libtool)Gravatar Thiago Macieira
Getting dependency information for static libraries requires extra files. Libtool creates .la files, which are "industry standard". qmake has its own .prl files, but it can create .la in a pinch if necessary. This change allows us to get the actual dependency information from libdivecomputer, without having to guess whether it linked to something else or not. If it changes in the future, we shouldn't have to do anything. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09We already try to link against libusb anywayGravatar Dirk Hohndel
No need for the special case here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Try hard not to link against a shared libdivecomputerGravatar Dirk Hohndel
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>
2013-10-09subsurface-configure.pri: add a libiconv dependencyGravatar Lubomir I. Ivanov
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>
2013-10-09subsurface-configure.pri: add another libxml/libxslt detection stageGravatar Lubomir I. Ivanov
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>
2013-10-09subsurface-configure.pri: enable the libusb detection stageGravatar Lubomir I. Ivanov
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>
2013-10-09subsurface-configure.pri: pkg-config detection changeGravatar Lubomir I. Ivanov
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>
2013-10-09Now bundle install on the Mac works without sudoGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Correct Mac bundle pathGravatar Dirk Hohndel
Should be /Applications (plural) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Don't set -Wno-maybe-uninitialized for clangGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Small fixes to the build notes for MacGravatar Dirk Hohndel
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>
2013-10-09Turn down warnings with Clang tooGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Turn down warnings (after going through them)Gravatar Dirk Hohndel
This was getting way too noisy with tons of false positives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Link static to libdivecomputerGravatar Anton Lundin
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>
2013-10-09Only define TRUE and FALSE if they aren't defined alreadyGravatar Dirk Hohndel
We did this for some situations but not for all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09windows.c: use the USERNAME enviroment variableGravatar Lubomir I. Ivanov
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>
2013-10-09Remove unnecessary moc includeGravatar Sergey Starosek
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>
2013-10-09Fix potential uninitialized variableGravatar Dirk Hohndel
Most of the "possibly unitialized" warnings are bogus, but this one is a potential real bug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09Disable unused functionGravatar Dirk Hohndel
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>
2013-10-08Merge http://github.com/thiagomacieira/subsurfaceGravatar Dirk Hohndel
2013-10-08Turn off exceptions in C++Gravatar Thiago Macieira
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>
2013-10-08Don't turn warnings on in Subsurface's buildGravatar Thiago Macieira
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>
2013-10-08Update the README and create an INSTALL file.Gravatar Thiago Macieira
Let the README contain generic information and move the build instructions to the INSTALL file. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Fix the Marble data installation for WindowsGravatar Thiago Macieira
Qt-only Marble expects the data to be on applicationDirPath() + "/data". Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Deploy some Qt plugins alongside the binaryGravatar Thiago Macieira
Only implemented for Windows for now. On Mac, macdeployqt copies all imageformat plugins on its own. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Use the $PATH environment variable to pass extra dirs for DLLsGravatar Thiago Macieira
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>
2013-10-08Disable the code that tries to find an alternate objdumpGravatar Thiago Macieira
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>
2013-10-08Add a tool to scan for dependencies on WindowsGravatar Thiago Macieira
Similar to ldd on Linux. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08And let qmake create the Mac bundle on its ownGravatar Thiago Macieira
It will even parse the Info.plist.in file for us and run sed on it. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Add information that goes into the Windows .exe fileGravatar Thiago Macieira
And drop the unnecessary .rc file. Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Add qmake rules to install SubsurfaceGravatar Thiago Macieira
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>
2013-10-08Remove the old buildsystemGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-10-08Implement a qmake-based build for SubsurfaceGravatar Thiago Macieira
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>
2013-10-08Fix crash when cancelling 'Add Dive'Gravatar Dirk Hohndel
If selected_dive is -1 get_dive(selected_dive) will return NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-08Avoid the memory leaks from translationsGravatar Dirk Hohndel
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>
2013-10-08Load translations at run timeGravatar Dirk Hohndel
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>
2013-10-08Make a copy of the translated textGravatar Dirk Hohndel
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>
2013-10-08Fix ui_%.h building to .uicGravatar Anton Lundin
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>
2013-10-08main.cpp: remove usage of subsurface_command_line_*Gravatar Lubomir I. Ivanov
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>
2013-10-08Fix edit + cancel = absolute zeroGravatar Patrick Valsecchi
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>
2013-10-08Fixed conversion error when downloading salinity from DCGravatar Patrick Valsecchi
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>
2013-10-07Fix some signedness issuesGravatar Dirk Hohndel
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>
2013-10-07Compile without depending on the global MAX macroGravatar Thiago Macieira
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>
2013-10-07Next round of code removal and header cleanupGravatar Dirk Hohndel
None of this is used anywhere Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07Remove even more code and declarationsGravatar Dirk Hohndel
There's lots more stuff that can go. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07Minor include file unwindingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07Remove unused prefs.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07Remove info.c/info.hGravatar Dirk Hohndel
The one remaining helper function in there was moved to maintab.cpp (which was the one remaining user). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07Allow passing NULL as second argument to ascii_strtodGravatar Dirk Hohndel
We do this in our own sources... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>