swift
lastserver.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_NETWORK_DATA_LASTSERVER_H
7 #define SWIFT_MISC_NETWORK_DATA_LASTSERVER_H
8 
9 #include "../server.h"
10 
11 #include "misc/datacache.h"
12 
13 namespace swift::misc::network::data
14 {
16  struct TLastServer : public TDataTrait<CServer>
17  {
19  static const char *key() { return "lastserver"; }
20 
22  static constexpr bool isPinned() { return true; }
23 
25  static const QString &humanReadable()
26  {
27  static const QString name("Last used server");
28  return name;
29  }
30  };
31 } // namespace swift::misc::network::data
32 
33 #endif // SWIFT_MISC_NETWORK_DATA_LASTSERVER_H
Base class for traits to be used as template argument to swift::misc::CData.
Definition: datacache.h:459
Trait for last (most recently) used server and user.
Definition: lastserver.h:17
static const char * key()
Key string of the value. Reimplemented in derived class.
Definition: lastserver.h:19
static constexpr bool isPinned()
If true, then value will be synchronously loaded when CDataCache is constructed. Good for small,...
Definition: lastserver.h:22
static const QString & humanReadable()
Optional human readable name.
Definition: lastserver.h:25