mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: fold ApplicationState into MainWindow
The application state is a desktop-only thing. The mobile UI also has its application state, but that is something completely different. The last remaining user of the application state was to flag whether the planner is active. Since this has all been unglobalized, the ApplicationState structure can be moved from core to the desktop UI. And there it can be made local to the MainWindow class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
80c92acc33
commit
5b3cb5898f
10 changed files with 27 additions and 56 deletions
|
@ -37,8 +37,6 @@ endif()
|
|||
|
||||
# compile the core library part in C, part in C++
|
||||
set(SUBSURFACE_CORE_LIB_SRCS
|
||||
applicationstate.cpp
|
||||
applicationstate.h
|
||||
checkcloudconnection.cpp
|
||||
checkcloudconnection.h
|
||||
cloudstorage.cpp
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "applicationstate.h"
|
||||
|
||||
static ApplicationState appState = (ApplicationState)-1; // Set to an invalid value
|
||||
|
||||
ApplicationState getAppState()
|
||||
{
|
||||
return appState;
|
||||
}
|
||||
|
||||
void setAppState(ApplicationState state)
|
||||
{
|
||||
appState = state;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef APPLICATIONSTATE_H
|
||||
#define APPLICATIONSTATE_H
|
||||
|
||||
// By using an enum class, the enum entries don't polute the global namespace.
|
||||
// Moreover, they are strongly typed. This means that they are not auto-converted
|
||||
// to integer types if e.g. used as array-indices.
|
||||
enum class ApplicationState {
|
||||
Default,
|
||||
EditDive,
|
||||
PlanDive,
|
||||
EditPlannedDive,
|
||||
EditDiveSite,
|
||||
FilterDive,
|
||||
Statistics,
|
||||
MapMaximized,
|
||||
ProfileMaximized,
|
||||
ListMaximized,
|
||||
InfoMaximized,
|
||||
Count
|
||||
};
|
||||
|
||||
ApplicationState getAppState();
|
||||
void setAppState(ApplicationState state);
|
||||
|
||||
#endif
|
|
@ -13,7 +13,6 @@
|
|||
#include "planner.h"
|
||||
#include "subsurface-time.h"
|
||||
#include "gettextfromc.h"
|
||||
#include "applicationstate.h"
|
||||
#include "metadata.h"
|
||||
#include "exif.h"
|
||||
#include "file.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue