Commit graph

9 commits

Author SHA1 Message Date
Berthold Stoeger
ccdd92aeb7 preferences: use std::string in struct preferences
This is a messy commit, because the "qPref" system relies
heavily on QString, which means lots of conversions between
the two worlds. Ultimately, I plan to base the preferences
system on std::string and only convert to QString when
pushing through Qt's property system or when writing into
Qt's settings.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00
Berthold Stoeger
5805b14734 core: use std::string for hashfile_name
One more free() removed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00
Berthold Stoeger
b82fdd1d20 general: remove (void) function parameter declarations
To my understanding, declaring empty parameter lists using "(void)"
is an artifact from the bad old K&R times, when functions were
declared without(!) parameters. Which in hindsight was an absolute
recipe for disaster. So for backwards compatibility, functions
without parameters had to be declared using "(void)" as "()"
could also mean "any function".

That was 40 years ago. Meanwhile, C++ introduced references,
which made it a necessity to declare the function parameters.
So "(void)" is redundant and inconsistent in C++ code and
just makes no sense.

Remove it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00
Berthold Stoeger
b56dd13add build: remove extern "C" linkage
No more C source files, no more necessity to use C-linkage.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00
Berthold Stoeger
c6cd10a43f core: make getCloudURL() return an std::string
Let's use std::string in the core. Notably, I'd like to make
the numerous main() functions mostly independent of Qt. Some
things will have to remain, such as argument parsing, of course.

This changes the API: instead of returning an error code and
taking a pointer to the actual return-value, return an
std::optional<std::string>> that is set if the function succeeds.

Returning an empty string in the error case might be simpler,
but oh well...

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
a123589efb core: convert git_info to std::string
Quite a bit of fallout in users of this structure.

Conveniently, since git-access.cpp is now C++ we can move
some helpers from the monstrous qthelper.cpp to git-access.cpp.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
29d71eb85e cleanup: remove picturedir_string()
This seems to be dead code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-03-25 06:49:35 +01:00
Berthold Stoeger
a133c6c4db mobile: turn testqml into a std::string
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-03-10 11:01:42 +13:00
Berthold Stoeger
76c2069fa8 core: port subsurface-startup.c to C++
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-03-10 11:01:42 +13:00
Renamed from core/subsurfacestartup.c (Browse further)