With Qt4.8.5 Locale::uiLanguages() sometimes doesn't return the country, just
the language. This works around this by recreating the locale if this has
happened.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
'share' is under Subsurface.app - you don't need a 'subsurface' directory
under 'share'.
This also installs the processed translations.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We check the current OS and pass it as 'darwin' (osx), 'linux'
or 'win' to the get-version shell script.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Certain versions of mingw32-make will try to "CreateProcess"
passing the contents of CC and CXX. On win32, with CONFIG += silent
CC and CXX become composite containing multiple commands
such as "@echo... && gcc", which produces undesired results.
For the time being, do not automatically enable "silent" mode
if the current OS is win32. Possibly a better solution can be
found later on.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These were created by converting the exting translations from po to ts
lconvert po/xx_yy.po -o subsurface_xx_yy.ts
and then merging in the new strings
lupdate subsurface.pro
You convert those into .qm files with lrelease and then localization
should work. Of course a good bit of new strings are still untranslated -
and lots of Gtk strings are still included.
This still needs to be included in the build system.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just to make sure there's no confusion - we are NOT calling gettext. We
are calling tr from a gettext like interface.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This may seem like a really odd change - but with this change the Qt tools
can correctly parse the C files (and qt-gui.cpp) and get the context for
the translatable strings right.
It's not super-pretty (I'll admit that _("string literal") is much easier
on the eye than translate("gettextFromC", "string literal") ) but I think
this will be the price of success.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>