Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Berthold Stoeger
Dear all, SettingsObjectWrapper.cpp is a glue between the C-style pref struct and the Qt-frontend. The setter functions are full of repetitive code (in some cases with subtle differences). In principle they always do: - check if difference (return if none) - set field in pref struct - set fie

PATCH - update user manual to reflect changes to smtk2ssfr

2017-11-18 Thread Pedro Neves
Dirk: A small patch to update the user manual to reflect the changes necessary to build smtk2ssfr import tool. Mostly based on the instructions provided by Salva... Cheers: Pedro >From 2ab7e644db5af6ead0461464b35ac2105002465c Mon Sep 17 00:00:00 2001 From: Pedro Neves Date: Sat, 18 Nov 201

Re: [Subsurface-divelog/subsurface] PATCH. Replace print template for single dive per page (#828)

2017-11-18 Thread Willem Ferguson
On 18/11/2017 00:01, Lubomir I. Ivanov wrote: *@neolit123* requested changes on this pull request. @willemferguson hi, Willem. i've made a more detailed review for this commit. it needs work, before we can accept it in. so, please, comment on my comments i

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Dirk Hohndel
Hi Berthold, > On Nov 18, 2017, at 12:02 AM, Berthold Stoeger > wrote: > > SettingsObjectWrapper.cpp is a glue between the C-style pref struct and the > Qt-frontend. The setter functions are full of repetitive code (in some cases > with subtle differences). In principle they always do: > - ch

Re: [Subsurface-divelog/subsurface] PATCH. Replace print template for single dive per page (#828)

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 17:51, Willem Ferguson wrote: > On 18/11/2017 00:01, Lubomir I. Ivanov wrote: > > @neolit123 requested changes on this pull request. > > @willemferguson > > hi, Willem. i've made a more detailed review for this commit. it needs work, > before we can accept it in. so, please,

Re: problem with testing version of subsurface installation

2017-11-18 Thread Dirk Hohndel
Hi Vincent > On Nov 18, 2017, at 4:45 AM, vavincavent wrote: > > hi all, i've a problem with installation of subsurface. > I've made a fresh directory: > ~/src/ > I've cloned subsurface : > vincent@ASUS-R558UV:~/src$ git clone https://github.com/Subsurface-dive > log/subsurface.git > > an

Re: problem with testing version of subsurface installation

2017-11-18 Thread Dirk Hohndel
> On Nov 18, 2017, at 8:13 AM, Dirk Hohndel wrote: > > Which OS are you on? [...] > I now want to know even more which OS you are building on. And in the meantime I have pushed a commit to fix the bug. Please try again /D ___ subsurface mailing li

bool different in C and C++?

2017-11-18 Thread Berthold Stoeger
Dear all, in core/pref.h we find the comment /* can't use 'bool' for the boolean values - different size in C and C++ */ Ironically, the same file is full of bool struct members, so it seems to rely on the fact that this comment is wrong. The fact is confirmed by my tests: #include #include i

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 17:53, Dirk Hohndel wrote: > Hi Berthold, > >> On Nov 18, 2017, at 12:02 AM, Berthold Stoeger >> wrote: >> > >> For consistency, I made a few C-strings non-const. And ultimately also the >> return of system_default_filename(void). If preferred, the latter could be >> k

Re: bool different in C and C++?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 18:19, Berthold Stoeger wrote: > Dear all, > > in core/pref.h we find the comment > /* can't use 'bool' for the boolean values - different size in C and C++ */ > > Ironically, the same file is full of bool struct members, so it seems to rely > on the fact that this comment i

Re: problem with testing version of subsurface installation

2017-11-18 Thread vavincavent
Hi Dirk, My OS is Debian : vincent@ASUS-R558UV:~/src$ uname -a Linux ASUS-R558UV 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux Vincent. Le samedi 18 novembre 2017 à 08:13 -0800, Dirk Hohndel a écrit : > Hi Vincent > > > On Nov 18, 2017, at 4:45 AM, vavincavent > > wrote:

Re: problem with testing version of subsurface installation

2017-11-18 Thread vavincavent
It seems to be working just with exucuting build.sh with sudo...!! vincent@ASUS-R558UV:~/src$ sudo ./subsurface/scripts/build.sh I've joined new log file. Vincent. Le samedi 18 novembre 2017 à 08:13 -0800, Dirk Hohndel a écrit : > Hi Vincent > > > On Nov 18, 2017, at 4:45 AM, vavincavent > > wro

Re: bool different in C and C++?

2017-11-18 Thread Berthold Stoeger
On Samstag, 18. November 2017 17:34:59 CET Lubomir I. Ivanov wrote: > On 18 November 2017 at 18:19, Berthold Stoeger > > On the other hand, many of the boolean settings are indeed defined as > > short. Shouldn't this be made consistent? > > both sizeof(short) and sizeof(bool) are implementation de

Re: bool different in C and C++?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 19:26, Berthold Stoeger wrote: > On Samstag, 18. November 2017 17:34:59 CET Lubomir I. Ivanov wrote: >> On 18 November 2017 at 18:19, Berthold Stoeger >> > On the other hand, many of the boolean settings are indeed defined as >> > short. Shouldn't this be made consistent? >>

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Berthold Stoeger
Hi Dirk, On Samstag, 18. November 2017 16:53:43 CET Dirk Hohndel wrote: > > On Nov 18, 2017, at 12:02 AM, Berthold Stoeger > > wrote: > > Side note: Unfortunately, in some cases representations in pref and > > SettingsObjectWrapper differ. :( > > Yes - and in most cases I think there are good re

Re: [Subsurface-divelog/subsurface] PATCH. Replace print template for single dive per page (#828)

2017-11-18 Thread Willem Ferguson
On 18/11/2017 18:09, Lubomir I. Ivanov wrote: On 18 November 2017 at 17:51, Willem Ferguson wrote: On 18/11/2017 00:01, Lubomir I. Ivanov wrote: @neolit123 requested changes on this pull request. @willemferguson hi, Willem. i've made a more detailed review for this commit. it needs work, bef

Re: [Subsurface-divelog/subsurface] PATCH. Replace print template for single dive per page (#828)

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 20:06, Willem Ferguson wrote: > On 18/11/2017 18:09, Lubomir I. Ivanov wrote: >> >> On 18 November 2017 at 17:51, Willem Ferguson >> wrote: >>> >>> On 18/11/2017 00:01, Lubomir I. Ivanov wrote: >>> >>> @neolit123 requested changes on this pull request. >>> >>> @willemfergus

Re: bool different in C and C++?

2017-11-18 Thread Linus Torvalds
On Sat, Nov 18, 2017 at 9:26 AM, Berthold Stoeger wrote: > > Sure, but can these definitions be different for C and C++ on any sane > platform? Historically, yes, very much. "bool" didn't really exist in C, so you will find code that does #define int bool or typedef int bool; all over

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Berthold Stoeger
On Samstag, 18. November 2017 17:23:05 CET Lubomir I. Ivanov wrote: > On 18 November 2017 at 17:53, Dirk Hohndel wrote: > >> On Nov 18, 2017, at 12:02 AM, Berthold Stoeger wrote: > > > >> For consistency, I made a few C-strings non-const. And ultimately also > >> the > >> return of system_defa

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 20:19, Berthold Stoeger wrote: > On Samstag, 18. November 2017 17:23:05 CET Lubomir I. Ivanov wrote: >> On 18 November 2017 at 17:53, Dirk Hohndel wrote: >> >> On Nov 18, 2017, at 12:02 AM, Berthold Stoeger > wrote: >> >> >> >> For consistency, I made a few C-strings non-

Re: bool different in C and C++?

2017-11-18 Thread Berthold Stoeger
On Samstag, 18. November 2017 19:11:53 CET Linus Torvalds wrote: > On Sat, Nov 18, 2017 at 9:26 AM, Berthold Stoeger > > wrote: > > Sure, but can these definitions be different for C and C++ on any sane > > platform? > > Historically, yes, very much. Thank you, that was an interesting read. >

Re: bool different in C and C++?

2017-11-18 Thread Linus Torvalds
On Sat, Nov 18, 2017 at 10:40 AM, Berthold Stoeger wrote: > > I figure pref.h counts as such a local use, because it is purely an > application-internal thing? Or would you prefer going the short (or char?) > route? We seem to depend on "bool" a lot, so might as well keep them that way. I actual

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Berthold Stoeger
On Samstag, 18. November 2017 19:21:34 CET Lubomir I. Ivanov wrote: > On 18 November 2017 at 20:19, Berthold Stoeger > > wrote: > > On Samstag, 18. November 2017 17:23:05 CET Lubomir I. Ivanov wrote: > >> On 18 November 2017 at 17:53, Dirk Hohndel wrote: > >> >> On Nov 18, 2017, at 12:02 AM, Ber

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 21:17, Berthold Stoeger wrote: > OK, prepared such a PR. > as noted at the PR comments. could you run your build with `-Wall` to see if these changes don't introduce a lot of (char *) <-> (const char *) cast warnings? > Thereby I noted two things: > > 1) In getCloudURL() i

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 21:21, Lubomir I. Ivanov wrote: > On 18 November 2017 at 21:17, Berthold Stoeger > wrote: >> OK, prepared such a PR. >> > > as noted at the PR comments. could you run your build with `-Wall` to > see if these changes don't introduce a lot of (char *) <-> (const char > *) ca

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Berthold Stoeger
On Samstag, 18. November 2017 20:25:37 CET Lubomir I. Ivanov wrote: > On 18 November 2017 at 21:21, Lubomir I. Ivanov wrote: > > On 18 November 2017 at 21:17, Berthold Stoeger > > > > wrote: > >> OK, prepared such a PR. > > > > as noted at the PR comments. could you run your build with `-Wall`

Suspicious if/else constructs

2017-11-18 Thread Berthold Stoeger
Dear all, at the suggestion of Lubomir I compiled with -Wall and I got two g++ warnings, which indeed point to two highly suspicious if/else constructs. The first one is trivial (PR submited). For the second one, I simply don't understand the intent of the indent (heh): In qt-models/diveplanner

Re: Suspicious if/else constructs

2017-11-18 Thread Stefan Fuchs
Hallo Berthold, Am 18.11.2017 um 21:50 schrieb Berthold Stoeger: > In qt-models/diveplannermodel.cpp:341, the if is indented as if it was part > of > the outer if. But it isn't owing to missing braces. Since I don't know the > meaning of "value", I can't decide in this case... Ups, that is a mi

Re: Suspicious if/else constructs

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 23:05, Stefan Fuchs wrote: > Hallo Berthold, > > Am 18.11.2017 um 21:50 schrieb Berthold Stoeger: > > In qt-models/diveplannermodel.cpp:341, the if is indented as if it was part > of > the outer if. But it isn't owing to missing braces. Since I don't know the > meaning of "v

Re: Replace repetitive code in SettingsObjectWrapper.cpp by functions?

2017-11-18 Thread Dirk Hohndel
> On Nov 18, 2017, at 11:17 AM, Berthold Stoeger > wrote: > > Thereby I noted two things: > > 1) In getCloudURL() in core/qthelper.cpp, the cloud_storate_email_encoded > member is set, but it seems not to be written to disk. I looked at that code recently and am struggling with the overall l