Refactor some classes into the backend

LootState and LootSettings aren't GUI-specific.
This commit is contained in:
Oliver Hamlet
2016-05-23 07:15:23 +01:00
parent 44a0d8505d
commit 4fd3fb9695
12 changed files with 30 additions and 34 deletions
+11 -15
View File
@@ -120,7 +120,9 @@ IF (NOT DEFINED CEF_ROOT)
set (CEF_ROOT "../../cef")
ENDIF ()
set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.cpp"
set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/app/loot_settings.cpp"
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_state.cpp"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.cpp"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/file.cpp"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/location.cpp"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/message.cpp"
@@ -142,7 +144,9 @@ set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.c
"${CMAKE_SOURCE_DIR}/src/backend/plugin_sorter.cpp"
"${CMAKE_BINARY_DIR}/generated/globals.cpp")
set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_settings.h"
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_state.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/file.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/location.h"
@@ -160,6 +164,7 @@ set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
"${CMAKE_SOURCE_DIR}/src/backend/plugin/plugin.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/git_helper.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/helpers.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/json.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/language.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/version.h"
"${CMAKE_SOURCE_DIR}/src/backend/helpers/yaml_set_helpers.h"
@@ -172,20 +177,13 @@ set (LOOT_GUI_SRC ${LOOT_SRC}
"${CMAKE_SOURCE_DIR}/src/gui/handler.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_handler.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_app.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_settings.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_state.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/scheme.cpp"
"${CMAKE_SOURCE_DIR}/src/resource.rc")
set (LOOT_GUI_HEADERS ${LOOT_HEADERS}
# Code the API doesn't need.
"${CMAKE_SOURCE_DIR}/src/backend/helpers/json.h"
# Actual GUI code.
"${CMAKE_SOURCE_DIR}/src/gui/handler.h"
"${CMAKE_SOURCE_DIR}/src/gui/loot_handler.h"
"${CMAKE_SOURCE_DIR}/src/gui/loot_app.h"
"${CMAKE_SOURCE_DIR}/src/gui/loot_settings.h"
"${CMAKE_SOURCE_DIR}/src/gui/loot_state.h"
"${CMAKE_SOURCE_DIR}/src/gui/scheme.h"
"${CMAKE_SOURCE_DIR}/src/gui/resource.h")
@@ -204,8 +202,6 @@ set (LOOT_VALIDATOR_HEADERS ${LOOT_HEADERS})
set (LOOT_TESTS_SRC ${LOOT_SRC}
"${CMAKE_SOURCE_DIR}/src/api/loot_db.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_settings.cpp"
"${CMAKE_SOURCE_DIR}/src/gui/loot_state.cpp"
"${CMAKE_SOURCE_DIR}/src/tests/main.cpp")
set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/base_game_test.h"
@@ -226,7 +222,9 @@ set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/base_game_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/api/loot_update_masterlist_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/api/loot_write_minimal_list_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/api/test_api.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_settings_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/app/loot_state_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_cache_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/game/game_settings_test.h"
@@ -248,9 +246,7 @@ set (LOOT_TESTS_HEADERS "${CMAKE_SOURCE_DIR}/src/tests/base_game_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/plugin/plugin_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/masterlist_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/metadata_list_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/backend/plugin_sorter_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/gui/loot_settings_test.h"
"${CMAKE_SOURCE_DIR}/src/tests/gui/loot_state_test.h")
"${CMAKE_SOURCE_DIR}/src/tests/backend/plugin_sorter_test.h")
source_group("Header Files\\backend" FILES ${LOOT_HEADERS})
source_group("Header Files\\gui" FILES ${LOOT_GUI_HEADERS})
@@ -22,8 +22,8 @@
<http://www.gnu.org/licenses/>.
*/
#ifndef LOOT_GUI_LOOT_SETTINGS
#define LOOT_GUI_LOOT_SETTINGS
#ifndef LOOT_BACKEND_LOOT_SETTINGS
#define LOOT_BACKEND_LOOT_SETTINGS
#include "backend/game/game_settings.h"
#include "backend/helpers/language.h"
@@ -24,10 +24,10 @@
#include "loot_state.h"
#include "../backend/error.h"
#include "../backend/globals.h"
#include "../backend/helpers/helpers.h"
#include "../backend/helpers/language.h"
#include "backend/error.h"
#include "backend/globals.h"
#include "backend/helpers/helpers.h"
#include "backend/helpers/language.h"
#include <boost/filesystem/fstream.hpp>
#include <boost/format.hpp>
@@ -22,8 +22,8 @@
<http://www.gnu.org/licenses/>.
*/
#ifndef __LOOT_GUI_LOOT_STATE__
#define __LOOT_GUI_LOOT_STATE__
#ifndef LOOT_BACKEND_LOOT_STATE
#define LOOT_BACKEND_LOOT_STATE
#include "loot_settings.h"
#include "backend/game/game.h"
+3 -3
View File
@@ -25,9 +25,9 @@
#ifndef __LOOT_GUI_HANDLER__
#define __LOOT_GUI_HANDLER__
#include "loot_state.h"
#include "../backend/plugin/plugin.h"
#include "../backend/metadata/plugin_metadata.h"
#include "backend/app/loot_state.h"
#include "backend/plugin/plugin.h"
#include "backend/metadata/plugin_metadata.h"
#include <include/wrapper/cef_message_router.h>
+1 -1
View File
@@ -25,7 +25,7 @@
#ifndef __LOOT_GUI_LOOT_APP__
#define __LOOT_GUI_LOOT_APP__
#include "loot_state.h"
#include "backend/app/loot_state.h"
#include <include/cef_app.h>
#include <include/wrapper/cef_message_router.h>
+1 -1
View File
@@ -25,7 +25,7 @@
#ifndef __LOOT_GUI_LOOT_HANDLER__
#define __LOOT_GUI_LOOT_HANDLER__
#include "loot_state.h"
#include "backend/app/loot_state.h"
#include <include/cef_client.h>
#include <include/wrapper/cef_message_router.h>
+2 -2
View File
@@ -23,8 +23,8 @@
*/
#include "loot_app.h"
#include "loot_state.h"
#include "../backend/globals.h"
#include "backend/app/loot_state.h"
#include "backend/globals.h"
#ifdef _WIN32
#include <windows.h>
@@ -25,7 +25,7 @@ along with LOOT. If not, see
#ifndef LOOT_TEST_GUI_LOOT_SETTINGS
#define LOOT_TEST_GUI_LOOT_SETTINGS
#include "gui/loot_settings.h"
#include "backend/app/loot_settings.h"
#include "backend/globals.h"
namespace loot {
@@ -25,7 +25,7 @@ along with LOOT. If not, see
#ifndef LOOT_TEST_GUI_LOOT_STATE
#define LOOT_TEST_GUI_LOOT_STATE
#include "gui/loot_state.h"
#include "backend/app/loot_state.h"
#include <gtest/gtest.h>
+2 -2
View File
@@ -41,6 +41,8 @@
#include "api/loot_update_masterlist_test.h"
#include "api/loot_write_minimal_list_test.h"
#include "api/test_api.h"
#include "backend/app/loot_settings_test.h"
#include "backend/app/loot_state_test.h"
#include "backend/game/game_test.h"
#include "backend/game/game_cache_test.h"
#include "backend/game/game_settings_test.h"
@@ -63,8 +65,6 @@
#include "backend/masterlist_test.h"
#include "backend/metadata_list_test.h"
#include "backend/plugin_sorter_test.h"
#include "gui/loot_settings_test.h"
#include "gui/loot_state_test.h"
#include <boost/log/core.hpp>