mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
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:
37
src/blackmisc/simulation/data/lastmodel.h
Normal file
37
src/blackmisc/simulation/data/lastmodel.h
Normal 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
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user