refs #478 minor improvements

* updated / clean-up of global property indexes
* beta test function in CProject
* typo in math utils
This commit is contained in:
Klaus Basan
2015-10-09 03:23:28 +02:00
committed by Mathew Sutcliffe
parent 805ebb109b
commit dff7ed5a90
9 changed files with 55 additions and 36 deletions

View File

@@ -30,7 +30,7 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexIsoCode = BlackMisc::CPropertyIndex::GlobalIndexCountry,
IndexIsoCode = BlackMisc::CPropertyIndex::GlobalIndexCCountry,
IndexName,
IndexNameIso,
IndexIsoName

View File

@@ -33,7 +33,7 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexName = BlackMisc::CPropertyIndex::GlobalIndexIdentifier,
IndexName = BlackMisc::CPropertyIndex::GlobalIndexCIdentifier,
IndexMachineId,
IndexMachineIdBase64,
IndexMachineName,

View File

@@ -100,7 +100,7 @@ namespace BlackMisc
static double normalizeDegrees(double degrees);
//! Random number between low and high
static int randomIntger(int low, int high)
static int randomInteger(int low, int high)
{
return qrand() % ((high + 1) - low) + low;
}

View File

@@ -190,6 +190,12 @@ namespace BlackMisc
#endif
}
bool CProject::isBetaTest()
{
//! \todo however we do it
return false;
}
bool CProject::isRunningOnWindowsNtPlatform()
{
#ifdef Q_OS_WIN
@@ -214,6 +220,11 @@ namespace BlackMisc
return p.cd("samples");
}
bool CProject::isRunningInBetaOrDeveloperEnvironment()
{
return isBetaTest() || isRunningInDeveloperEnvironment();
}
int CProject::getMajorMinor(int index)
{
QString v = version();

View File

@@ -88,12 +88,18 @@ namespace BlackMisc
//! Release build?
static bool isReleaseBuild();
//! Beta test?
static bool isBetaTest();
//! Running on Windows NT platform?
static bool isRunningOnWindowsNtPlatform();
//! Running in dev.environment, so on a programmers machine
static bool isRunningInDeveloperEnvironment();
//! Beta / dev.environment?
static bool isRunningInBetaOrDeveloperEnvironment();
//! Application directory where current application is located
static QString getApplicationDir();

View File

@@ -49,43 +49,45 @@ namespace BlackMisc
GlobalIndexCPhysicalQuantity = 100,
GlobalIndexCStatusMessage = 200,
GlobalIndexCNameVariantPair = 300,
GlobalIndexTimestampBased = 400,
GlobalIndexIdentifier = 500,
GlobalIndexRgbColor = 600,
GlobalIndexCountry = 700,
GlobalIndexITimestampBased = 400,
GlobalIndexCIdentifier = 500,
GlobalIndexCRgbColor = 600,
GlobalIndexCCountry = 700,
GlobalIndexCCallsign = 1000,
GlobalIndexCAircraftSituation = 1200,
GlobalIndexCAtcStation = 1300,
GlobalIndexCAirport = 1400,
GlobalIndexCAircraftParts = 1500,
GlobalIndexCAircraftLights = 1600,
GlobalIndexCLivery = 1700,
GlobalIndexCAircraftSituation = 1100,
GlobalIndexCAtcStation = 1200,
GlobalIndexCAirport = 1300,
GlobalIndexCAircraftParts = 1400,
GlobalIndexCAircraftLights = 1500,
GlobalIndexCLivery = 1600,
GlobalIndexCModulator = 2000,
GlobalIndexCTransponder = 2100,
GlobalIndexCAircraftIcaoData = 2500,
GlobalIndexCAircraftIcaoCode = 2600,
GlobalIndexCAirlineIcaoCode = 2700,
GlobalIndexCAirportIcaoCode = 2800,
GlobalIndexCMetar = 2900,
GlobalIndexCCloudLayer = 2910,
GlobalIndexCPresentWeather = 2920,
GlobalIndexCWindLayer = 2930,
GlobalIndexICoordinateGeodetic = 3000,
GlobalIndexCCoordinateGeodetic = 3100,
GlobalIndexCClient = 4000,
GlobalIndexCUser = 4100,
GlobalIndexCServer = 4200,
GlobalIndexCAircraftModel = 4300,
GlobalIndexCSimulatedAircraft = 4400,
GlobalIndexCTextMessage = 4600,
GlobalIndexCSimulatorSetup = 4700,
GlobalIndexCAircraftCfgEntries = 4800,
GlobalIndexCDistributor = 4900,
GlobalIndexVPilotModelRule = 5000,
GlobalIndexCVoiceRoom = 6000,
GlobalIndexCSettingKeyboardHotkey = 7000,
GlobalIndexIDatastoreInteger = 8000,
GlobalIndexIDatastoreString = 8100,
GlobalIndexCMetar = 4000,
GlobalIndexCCloudLayer = 4100,
GlobalIndexCPresentWeather = 4200,
GlobalIndexCWindLayer = 4300,
GlobalIndexICoordinateGeodetic = 5000,
GlobalIndexCCoordinateGeodetic = 5100,
GlobalIndexCClient = 6000,
GlobalIndexCUser = 6100,
GlobalIndexCServer = 6200,
GlobalIndexCUrl = 6300,
GlobalIndexCAircraftModel = 6400,
GlobalIndexCSimulatedAircraft = 6500,
GlobalIndexCTextMessage = 6600,
GlobalIndexCSimulatorSetup = 6700,
GlobalIndexCAircraftCfgEntries = 6800,
GlobalIndexCDistributor = 6900,
GlobalIndexCVPilotModelRule = 8000,
GlobalIndexCVoiceRoom = 9000,
GlobalIndexCSettingKeyboardHotkey = 10000,
GlobalIndexIDatastoreInteger = 11000,
GlobalIndexIDatastoreString = 11100,
GlobalIndexCGlobalSetup = 12000,
GlobalIndexAbuseMode = 20000 // property index abused as map key or otherwise, to be removed if no longer needed
};

View File

@@ -27,7 +27,7 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexRed = BlackMisc::CPropertyIndex::GlobalIndexRgbColor,
IndexRed = BlackMisc::CPropertyIndex::GlobalIndexCRgbColor,
IndexGreen,
IndexBlue,
IndexWebHex

View File

@@ -34,7 +34,7 @@ namespace BlackMisc
//! Property indexes
enum ColumnIndex
{
IndexModelName = CPropertyIndex::GlobalIndexVPilotModelRule,
IndexModelName = CPropertyIndex::GlobalIndexCVPilotModelRule,
IndexFolder,
IndexTypeCode,
IndexCallsignPrefix

View File

@@ -26,7 +26,7 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexUtcTimestamp = BlackMisc::CPropertyIndex::GlobalIndexTimestampBased,
IndexUtcTimestamp = BlackMisc::CPropertyIndex::GlobalIndexITimestampBased,
IndexUtcTimestampFormattedYmdhms,
IndexUtcTimestampFormattedYmdhmsz,
IndexUtcTimestampFormattedDhms,