mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #656, MS review items https://dev.vatsim-germany.org/issues/656#note-4
Remove defaultValue where not needed
This commit is contained in:
@@ -30,14 +30,9 @@ namespace BlackCore
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
//! Default value
|
||||
static const BlackMisc::Network::CAuthenticatedUser &defaultValue()
|
||||
{
|
||||
static const BlackMisc::Network::CAuthenticatedUser user;
|
||||
return user;
|
||||
}
|
||||
//! Cache lifetime
|
||||
static int timeToLive() { return 18 * 60 * 60 * 1000; }
|
||||
};
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/* Copyright (C) 2016
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "dbcaches.h"
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Data
|
||||
{
|
||||
const BlackMisc::Simulation::CAircraftModelList &DbModelCache::defaultValue()
|
||||
{
|
||||
static const CAircraftModelList ml;
|
||||
return ml;
|
||||
}
|
||||
|
||||
const BlackMisc::Aviation::CAirlineIcaoCodeList &DbAirlineIcaoCache::defaultValue()
|
||||
{
|
||||
static const CAirlineIcaoCodeList al;
|
||||
return al;
|
||||
}
|
||||
|
||||
const BlackMisc::Aviation::CAircraftIcaoCodeList &DbAircraftIcaoCache::defaultValue()
|
||||
{
|
||||
static const CAircraftIcaoCodeList al;
|
||||
return al;
|
||||
}
|
||||
|
||||
const BlackMisc::CCountryList &DbCountryCache::defaultValue()
|
||||
{
|
||||
static const CCountryList cl;
|
||||
return cl;
|
||||
}
|
||||
|
||||
const BlackMisc::Aviation::CLiveryList &DbLiveryCache::defaultValue()
|
||||
{
|
||||
static const CLiveryList ll;
|
||||
return ll;
|
||||
}
|
||||
|
||||
const CDistributorList &DbDistributorCache::defaultValue()
|
||||
{
|
||||
static const CDistributorList dl;
|
||||
return dl;
|
||||
}
|
||||
|
||||
const BlackMisc::Network::CUrl &DbIcaoReaderBaseUrl::defaultValue()
|
||||
{
|
||||
static const CUrl url;
|
||||
return url;
|
||||
}
|
||||
|
||||
const CUrl &DbModelReaderBaseUrl::defaultValue()
|
||||
{
|
||||
static const CUrl url;
|
||||
return url;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
@@ -31,9 +31,6 @@ namespace BlackCore
|
||||
//! Trait for DB model cache
|
||||
struct DbModelCache : public BlackMisc::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CAircraftModelList &defaultValue();
|
||||
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
|
||||
@@ -44,9 +41,6 @@ namespace BlackCore
|
||||
//! Trait for DB distributor cache
|
||||
struct DbDistributorCache : public BlackMisc::CDataTrait<BlackMisc::Simulation::CDistributorList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CDistributorList &defaultValue();
|
||||
|
||||
//! Defer loading (no currently small)
|
||||
static constexpr bool isDeferred() { return false; }
|
||||
|
||||
@@ -57,9 +51,6 @@ namespace BlackCore
|
||||
//! Trait for DB liveries
|
||||
struct DbLiveryCache : public BlackMisc::CDataTrait<BlackMisc::Aviation::CLiveryList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Aviation::CLiveryList &defaultValue();
|
||||
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
|
||||
@@ -70,9 +61,6 @@ namespace BlackCore
|
||||
//! Trait for DB airline ICAO codes
|
||||
struct DbAirlineIcaoCache : public BlackMisc::CDataTrait<BlackMisc::Aviation::CAirlineIcaoCodeList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Aviation::CAirlineIcaoCodeList &defaultValue();
|
||||
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
|
||||
@@ -84,9 +72,6 @@ namespace BlackCore
|
||||
//! Trait for DB aircraft ICAO codes
|
||||
struct DbAircraftIcaoCache : public BlackMisc::CDataTrait<BlackMisc::Aviation::CAircraftIcaoCodeList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Aviation::CAircraftIcaoCodeList &defaultValue();
|
||||
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
|
||||
@@ -97,9 +82,6 @@ namespace BlackCore
|
||||
//! Trait for DB countries
|
||||
struct DbCountryCache : public BlackMisc::CDataTrait<BlackMisc::CCountryList>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::CCountryList &defaultValue();
|
||||
|
||||
//! Defer loading (no currently small)
|
||||
static constexpr bool isDeferred() { return false; }
|
||||
|
||||
@@ -110,9 +92,6 @@ namespace BlackCore
|
||||
//! Trait for ICAO reader base URL
|
||||
struct DbIcaoReaderBaseUrl : public BlackMisc::CDataTrait<BlackMisc::Network::CUrl>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Network::CUrl &defaultValue();
|
||||
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
@@ -123,9 +102,6 @@ namespace BlackCore
|
||||
//! Trait for ICAO reader base URL
|
||||
struct DbModelReaderBaseUrl : public BlackMisc::CDataTrait<BlackMisc::Network::CUrl>
|
||||
{
|
||||
//! Default value
|
||||
static const BlackMisc::Network::CUrl &defaultValue();
|
||||
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
|
||||
@@ -203,15 +203,7 @@ namespace BlackCore
|
||||
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
//! Default value
|
||||
static const CGlobalSetup &defaultValue()
|
||||
{
|
||||
static const CGlobalSetup gs;
|
||||
return gs;
|
||||
}
|
||||
};
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
@@ -126,13 +126,6 @@ namespace BlackCore
|
||||
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
//! Default value
|
||||
static const CUpdateInfo &defaultValue()
|
||||
{
|
||||
static const CUpdateInfo defaultValue;
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -129,15 +129,7 @@ namespace BlackCore
|
||||
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
//! Default value
|
||||
static const CVatsimSetup &defaultValue()
|
||||
{
|
||||
static const CVatsimSetup gs;
|
||||
return gs;
|
||||
}
|
||||
};
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
@@ -144,13 +144,6 @@ namespace BlackGui
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "guidockwidget"; }
|
||||
|
||||
//! Default value
|
||||
static const CSettingsDockWidgets &defaultValue()
|
||||
{
|
||||
static const CSettingsDockWidgets defaultValue;
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -32,13 +32,6 @@ namespace BlackMisc
|
||||
{
|
||||
//! Defer loading
|
||||
static constexpr bool isDeferred() { return true; }
|
||||
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CAircraftModelList &defaultValue()
|
||||
{
|
||||
static const BlackMisc::Simulation::CAircraftModelList ml;
|
||||
return ml;
|
||||
}
|
||||
};
|
||||
|
||||
//! \name Caches for own models on disk, loaded by BlackMisc::Simulation::IAircraftModelLoader
|
||||
|
||||
Reference in New Issue
Block a user