diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-05-10 19:51:43 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-12 12:33:55 -0700 |
commit | 75767c456a2889d213621866a9f7fbb108f3366d (patch) | |
tree | 1f941f73a58718affe6c199c510e08e0eec75f95 /core/qthelper.h | |
parent | 114b3d9d470e65c25bcb5711daf053478f30e319 (diff) | |
download | subsurface-75767c456a2889d213621866a9f7fbb108f3366d.tar.gz |
Turn application state into enum
The application state was encoded in a QByteArray. Thus, there was
no compile-time checking. Typos would lead to silent failures.
Turn the application state into an enum. Use the enum-class construct,
so that the values don't polute the global namespace. Moreover,
this makes them strongly typed, i.e. they don't auto-convert to
integers.
A disadvantage is that the enums now have to be cast to int
explicitly when used to index an array.
Replace two hash-maps in MainWindow to arrays of fixed sizes.
Move the application-state details into their own files.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.h')
-rw-r--r-- | core/qthelper.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/core/qthelper.h b/core/qthelper.h index 2a91df9ef..53b0cc59a 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -40,8 +40,6 @@ volume_t string_to_volume(const char *str, pressure_t workp); fraction_t string_to_fraction(const char *str); int getCloudURL(QString &filename); bool parseGpsText(const QString &gps_text, double *latitude, double *longitude); -QByteArray getCurrentAppState(); -void setCurrentAppState(const QByteArray &state); void init_proxy(); QString getUUID(); extern const QStringList videoExtensionsList; |