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_NETWORK_DATA_LASTSERVER_H
#define BLACKMISC_NETWORK_DATA_LASTSERVER_H
#include "../server.h"
#include "blackmisc/datacache.h"
namespace BlackMisc
{
namespace Network
{
namespace Data
{
//! Trait for last (most recently) used server and user
struct TLastServer : public TDataTrait<CServer>
{
//! Key in data cache
static const char *key() { return "lastserver"; }
//! First load is synchronous
static constexpr bool isPinned() { return true; }
};
} // ns
} // ns
} // ns
#endif // guard