Ref T215, remember last server and model as cache value

* also remember last server not VATSIM server
* remember last model used
* server list selector uses remembered value
* login component sets those values
This commit is contained in:
Klaus Basan
2018-01-02 02:47:47 +01:00
parent ee0d69faf2
commit 0975abcc46
10 changed files with 103 additions and 26 deletions

View File

@@ -0,0 +1,37 @@
/* Copyright (C) 2017
* swift project community / contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKMISC_SIMULATION_DATA_LASTMODEL_H
#define BLACKMISC_SIMULATION_DATA_LASTMODEL_H
#include "blackmisc/simulation/aircraftmodel.h"
#include "blackmisc/datacache.h"
namespace BlackMisc
{
namespace Simulation
{
namespace Data
{
//! Last model used
struct TLastModel : public BlackMisc::TDataTrait<CAircraftModel>
{
//! \copydoc BlackCore::TSettingTrait::key
static const char *key() { return "lastaircraftmodel"; }
//! \copydoc BlackCore::TSettingTrait::humanReadable
static const QString &humanReadable() { static const QString name("Own aircraft model"); return name; }
};
} // ns
} // ns
} // ns
#endif // guard

View File

@@ -29,7 +29,7 @@ namespace BlackMisc
namespace Data
{
//! Trait for model cache
struct TModelCache : public BlackMisc::TDataTrait<BlackMisc::Simulation::CAircraftModelList>
struct TModelCache : public TDataTrait<CAircraftModelList>
{
//! Defer loading
static constexpr bool isDeferred() { return true; }