Replace repetitive code in SettingsObjectWrapper.cpp by functions?
Berthold Stoeger
bstoeger at mail.tuwien.ac.at
Sat Nov 18 11:17:40 PST 2017
On Samstag, 18. November 2017 19:21:34 CET Lubomir I. Ivanov wrote:
> On 18 November 2017 at 20:19, Berthold Stoeger
>
> <bstoeger at mail.tuwien.ac.at> wrote:
> > On Samstag, 18. November 2017 17:23:05 CET Lubomir I. Ivanov wrote:
> >> On 18 November 2017 at 17:53, Dirk Hohndel <dirk at hohndel.org> wrote:
> >> >> On Nov 18, 2017, at 12:02 AM, Berthold Stoeger
> >
> > <bstoeger at mail.tuwien.ac.at> wrote:
> >> <snip>
> >>
> >> >> 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 kept const and the const cast away when assigning to the item of
> >> >> the
> >> >> pref struct.>
> >> >
> >> > That I'm not so sure about. We try to use these const declarations to
> >> > prevent users of these strings from modifying them when they are
> >> > supposed
> >> > to be immutable.
> >>
> >> i agree that things like system_default_...() calls should return a
> >> "const char *".
> >>
> >> const char *language;
> >> const char *lang_locale;
> >>
> >> ^ also make sense to me to be "const".
> >
> > I see your point. But shouldn't then the numerous other non-const strings
> > in pref.h also be made const?
>
> probably, yes.
OK, prepared such a PR.
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.
2) In uploadFinished() in core/cloudstorage.cpp, the cloud_storage_password
member is set, but it likewise seems not to be written to disk.
Are there some slot/signal subtleties that I'm missing or are these genuine
bugs?
Berthold
More information about the subsurface
mailing list