summaryrefslogtreecommitdiffstats
path: root/subsurfacestartup.h
AgeCommit message (Collapse)Author
2015-10-06Correctly copy preferencesGravatar Dirk Hohndel
When just assigning one structure to the other we copy the string pointers. If we then modify those strings in the copy, we happily free the strings of the original. And then resetting the preferences equally happily reused those strings, pointing to long since freed memory. I think what I did now is excessive for the current use case in that it copies a ton of strings that are unset in the default_prefs. But I figured this is a rarely used function and I might as well do it correctly. Also, once we implement multi user support with per user preferences we will be copying completely populated preferences around (at least that's my guess). Fixes #940 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-04Print paths to internal files in verbose modeGravatar Robert C. Helling
When run with -v option, this prints local file names like the path to the local git repository and the hash file. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18Free strduped prefs before exitGravatar Anton Lundin
This plugs a leak detected by valgrind. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-17Don't include stdbool.h when included from C++Gravatar Anton Lundin
As noted by Thiago Macieira, we shouldn't include stdbool.h when were included from a C++-file such as main.cpp Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Refactoring of the configuration handling.Gravatar Patrick Valsecchi
Before, when clicking the OK button on the preferences GUI, we were updating in-memory preferences from the GUI, saving them to the configuration file from the GUI, reloading from the file to the in-memory preferences. Then, to add to the ducplication, when the application was exiting, some fields were saved again. Basically the first step and the last step were useless appart from the fact the the other steps where missing a few fields here and there. This patch removes the first step and fixes the missing fields. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> ACKed-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Dependencies are too aggressive for version.hGravatar Dirk Hohndel
Apparently qmake can't tell that #include "version.h" and #include "libdivecomputer/version.h" are not the same thing. Instead of spending another bunch of hours on fixing the buildsystem I decided to just cleanup the spots where we actually use the version file and rename it to ssrf-version.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-09Use the same code for command line and gui for file handling.Gravatar Tomaz Canabrava
The Command line execution of Subsurface happened before the GUI was created, this leaded to various bugs by me(tm) over time. This patch seems to fix all of those, by reusing the same code for GUI interaction and CommandLine interaction. I had to rework how the main.c worked, it used to be C code calling C++ code, and this is non desirable, since C doesn't really understand C++. I Moved all of C-related code to 'subsurfacestartup.c/h' and created a tiny wrapper to call it, so all of the C code is still C code, and the new main.cpp calls the mainwindow->loadFiles and mainWindow->importFiles to get rid of the bugs that happened before. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>