diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-05-04 09:47:55 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-06 13:58:09 -0700 |
commit | 4d407dc666ba471946541c835da3bb5805b514bc (patch) | |
tree | 3994e6ea0bc19352bccfd7185615ee33051273a4 /cmake/Modules/FindLibdivecomputer.cmake | |
parent | c50e58d761c0c6e54219a3114a26bc033ddeee70 (diff) | |
download | subsurface-4d407dc666ba471946541c835da3bb5805b514bc.tar.gz |
pictures: turn QString into std::string for filenames
For undo of picture manipulation, it will be crucial that the
model and the core have the same order of pictures. The first
sort criterion will be time, the second filename in the case
that two pictures have, for whatever reason, the same timestamp.
However in the core we us C-strings and thus sort byte-wise
using strcmp. In the Qt-part we use QStrings, which sort according
to unicode encoding. To enable consistent sorting, change the
Qt-part to std::string, which uses a C-style 0-terminated string
as its backing store.
One might argue that in general filenames should use system-encoding
and therefore use std::string instead of QString. However, a
broader conversion to std::string turned out to be very painful,
since Qt is (deliberately?) difficult to use with std::string.
Notable all the file-manipulation functions don't take std::string
by default. Thus, this commit only converts the internal data
of DivePictureModel, but continues to use QString for the Qt-facing
interface.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'cmake/Modules/FindLibdivecomputer.cmake')
0 files changed, 0 insertions, 0 deletions