From 75767c456a2889d213621866a9f7fbb108f3366d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 10 May 2019 19:51:43 +0200 Subject: 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 --- packaging/ios/Subsurface-mobile.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'packaging') diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 1569929de..ea6a378ea 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -18,6 +18,7 @@ SOURCES += ../../subsurface-mobile-main.cpp \ ../../core/qtserialbluetooth.cpp \ ../../core/plannernotes.c \ ../../core/uemis-downloader.c \ + ../../core/applicationstate.cpp \ ../../core/qthelper.cpp \ ../../core/checkcloudconnection.cpp \ ../../core/color.cpp \ -- cgit v1.2.3-70-g09d2