refs #413 Access control of convertToQString changed from protected to public.

This commit is contained in:
Mathew Sutcliffe
2015-04-30 21:11:12 +01:00
parent 97d83e5e41
commit b64ae55a86
61 changed files with 24 additions and 78 deletions

View File

@@ -80,7 +80,6 @@ namespace BlackMisc
return CAudioDeviceInfo(InputDevice, defaultDeviceIndex(), "default");
}
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -100,7 +100,6 @@ namespace BlackMisc
*/
static const QString &protocolComplete() { static QString p("vvl://"); return p; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -272,7 +272,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -42,7 +42,6 @@ namespace BlackMisc
//! Set to on/off
void setOn(bool on) { m_on = on; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -153,7 +153,6 @@ namespace BlackMisc
//! Valid designator?
static bool isValidAirlineDesignator(const QString &airline);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -96,7 +96,6 @@ namespace BlackMisc
//! Returns object with all lights switched off
static CAircraftLights allLightsOff();
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -119,7 +119,6 @@ namespace BlackMisc
//! Corresponding callsign
void setCallsign(const BlackMisc::Aviation::CCallsign &callsign) { this->m_correspondingCallsign = callsign; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -143,7 +143,6 @@ namespace BlackMisc
//! Corresponding callsign
void setCallsign(const BlackMisc::Aviation::CCallsign &callsign) { this->m_correspondingCallsign = callsign; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -102,7 +102,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -51,7 +51,6 @@ namespace BlackMisc
//! Valid ICAO designator
static bool isValidIcaoDesignator(const QString &icaoCode);
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -48,11 +48,9 @@ namespace BlackMisc
FlightLevel //!< Flight level
};
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
public:
//! Default constructor: 0 Altitude true
CAltitude() : CValueObject(0, BlackMisc::PhysicalQuantities::CLengthUnit::m()), m_datum(MeanSeaLevel) {}

View File

@@ -248,7 +248,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -46,10 +46,10 @@ namespace BlackMisc
this->m_name = name;
}
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override { Q_UNUSED(i18n); return ""; }
public:
//! \brief Name
QString getName() const
{

View File

@@ -112,10 +112,10 @@ namespace BlackMisc
//! Representing icon
static const CIcon &convertToIcon(const CCallsign &callsign);
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;
protected:
//! Unify the callsign
static QString unifyCallsign(const QString &callsign);

View File

@@ -182,7 +182,6 @@ namespace BlackMisc
//! \copydoc CValueObject::toIcon
virtual CIcon toIcon() const override;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -45,11 +45,9 @@ namespace BlackMisc
True = 1 //!< true north
};
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
public:
//! \brief Default constructor: 0 heading true
CHeading() : CValueObject(0, BlackMisc::PhysicalQuantities::CAngleUnit::rad()), m_north(Magnetic) {}

View File

@@ -90,7 +90,6 @@ namespace BlackMisc
//! Is empty?
bool isEmpty() const { return this->m_message.isEmpty(); }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -82,6 +82,9 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
protected:
//! Default constructor
CModulator();
@@ -89,9 +92,6 @@ namespace BlackMisc
//! Constructor
CModulator(const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency);
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
//! Set active frequency
void setFrequencyActiveKHz(double frequencyKHz);

View File

@@ -70,7 +70,6 @@ namespace BlackMisc
//! All valid code pairs: AB, AC, AD ...
static const QStringList &codePairs();
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -74,7 +74,6 @@ namespace BlackMisc
//! \brief Get reference north (magnetic or true)
ReferenceNorth getReferenceNorth() const { return m_north; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -171,13 +171,13 @@ namespace BlackMisc
//! Is valid transponder code?
static bool isValidTransponderCode(qint32 transponderMode);
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
protected:
//! Default value?
virtual bool isDefaultValue() const { return this->m_transponderCode == 0; }
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTransponder)
int m_transponderCode; //!< Transponder code

View File

@@ -147,7 +147,6 @@ namespace BlackMisc
}
}
protected: // CValueObject overrides
//! \copydoc BlackMisc::CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override
{
@@ -157,6 +156,7 @@ namespace BlackMisc
return str += "}";
}
protected:
//! \copydoc BlackMisc::CValueObject::getMetaTypeId
int getMetaTypeId() const { return qMetaTypeId<C<T>>(); }

View File

@@ -402,7 +402,6 @@ namespace BlackMisc
//! Test for inequality.
bool operator !=(const CDictionary &other) const { return !(*this == other); }
protected:
//! \copydoc BlackMisc::CValueObject::convertToQString
//! \todo Fix brackets
virtual QString convertToQString(bool i18n = false) const override

View File

@@ -41,7 +41,6 @@ namespace BlackMisc
//! Get boolean hotkey function argument
bool getFunctionArgument() const { return m_hotkeyFuncArgument; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -56,7 +56,6 @@ namespace BlackMisc
//! Check if originating from the same process name
bool isFromSameProcessName() const;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -175,7 +175,6 @@ namespace BlackMisc
//! Coordinate by WGS84 position data
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::PhysicalQuantities::CLength &geodeticHeight = {});
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -74,6 +74,7 @@ namespace BlackMisc
//! Init by CAngle value
CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle);
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -31,7 +31,7 @@ namespace BlackMisc
//! Latitude
class BLACKMISC_EXPORT CLatitude : public CValueObject<CLatitude, CEarthAngle<CLatitude>>
{
protected:
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const
{
@@ -43,7 +43,6 @@ namespace BlackMisc
return s;
}
public:
//! Default constructor
CLatitude() = default;

View File

@@ -30,7 +30,7 @@ namespace BlackMisc
//! Longitude
class BLACKMISC_EXPORT CLongitude : public CValueObject<CLongitude, CEarthAngle<CLongitude>>
{
protected:
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const
{
@@ -40,7 +40,6 @@ namespace BlackMisc
return s;
}
public:
//! Default constructor
CLongitude() = default;

View File

@@ -69,7 +69,6 @@ namespace BlackMisc
//! Invalid button index
static qint32 getInvalidIndex() { return m_invalidIndex; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -203,7 +203,6 @@ namespace BlackMisc
*/
static QString toStringRepresentation(int key);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -91,7 +91,6 @@ namespace BlackMisc
return hotkeyFunction;
}
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -63,7 +63,6 @@ namespace BlackMisc
//! Implicit conversion
operator QPixmap() const { return this->toPixmap(); }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -105,7 +105,6 @@ namespace BlackMisc
//! Returns true if the category string contains the given substring.
bool contains(const QString &substring) const { return m_string.contains(substring); }
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -97,7 +97,6 @@ namespace BlackMisc
//! Register metadata
static void registerMetadata();
protected:
//! \copydoc BlackMisc::CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -82,11 +82,9 @@ namespace BlackMisc
//! topological sorting algorithm, to sort patterns by their generality.
bool isProperSubsetOf(const CLogPattern &other) const;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;
public:
//! \copydoc CValueObject::marshallToDbus()
void marshallToDbus(QDBusArgument &argument) const;

View File

@@ -63,7 +63,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -25,11 +25,10 @@ namespace BlackMisc
class BLACKMISC_EXPORT CAircraftMapping : public CValueObject<CAircraftMapping>
{
protected:
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
public:
//! Properties
enum ColumnIndex
{

View File

@@ -128,7 +128,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -91,7 +91,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -159,7 +159,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -136,7 +136,6 @@ namespace BlackMisc
//! Beautify real name, e.g. "JOE DoE" -> "Joe Doe";
static QString beautifyRealName(const QString &realName);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -68,7 +68,6 @@ namespace BlackMisc
//! All capabilities as list
static const QList<CVoiceCapabilities> &allCapabilities();
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -48,7 +48,6 @@ namespace BlackMisc
//! \copydoc CValueObject::toPixmap
virtual QPixmap toPixmap() const override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -247,13 +247,13 @@ namespace BlackMisc
// return this->getName(false);
// }
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override
{
return this->getSymbol(i18n);
}
public:
//! \copydoc CValueObject::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const
{

View File

@@ -222,8 +222,10 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
protected:
//! Default constructor
//! \todo Remove as part of MS' CValueObject refactoring
CPhysicalQuantity();
@@ -234,9 +236,6 @@ namespace BlackMisc
//! Constructor by parsed string, e.g. 10m
CPhysicalQuantity(const QString &unitString);
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
private:
double m_value; //!< numeric part
MU m_unit; //!< unit part

View File

@@ -29,11 +29,10 @@ namespace BlackMisc
*/
class BLACKMISC_EXPORT CPqString : public CValueObject<CPqString>
{
protected:
public:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
public:
//! Number separators / group separators
enum SeparatorMode
{

View File

@@ -127,10 +127,10 @@ namespace BlackMisc
return static_cast<int>(ev) == l.first();
}
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
protected:
//! \copydoc CValueObject::parseFromString
virtual void parseFromString(const QString &indexes) override;

View File

@@ -149,14 +149,13 @@ namespace BlackMisc
//! \copydoc CValueObject::convertFromQVariant
virtual void convertFromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
protected:
QMap<CPropertyIndex, CVariant> m_values; //!< values
bool m_wildcard; //!< wildcard
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;
protected:
QMap<CPropertyIndex, CVariant> m_values; //!< values
bool m_wildcard; //!< wildcard
public:
//! \copydoc CValueObject::marshallToDbus
void marshallToDbus(QDBusArgument &argument) const;

View File

@@ -49,7 +49,6 @@ namespace BlackMisc
//! Init with meaningful default values
void initDefaultValues();
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -88,7 +88,6 @@ namespace BlackMisc
//! \copydoc CValueObject::propertyByIndex
virtual CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -97,7 +97,6 @@ namespace BlackMisc
//! Init with meaningful default values
void initDefaultValues();
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -140,7 +140,6 @@ namespace BlackMisc
//! Model type
static QString modelTypeToString(ModelType type);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -128,7 +128,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
virtual void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -78,7 +78,6 @@ namespace BlackMisc
//! \copydoc BlackCore::IContextSettings::value
virtual BlackMisc::CStatusMessage value(const QString &path, const QString &command, const BlackMisc::CVariant &value, bool &changedFlag);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -105,7 +105,6 @@ namespace BlackMisc
//! Set the synchronisation flag
void setPartsSynchronized(bool synchronized) { m_partsSynchronized = synchronized; }
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -71,7 +71,6 @@ namespace BlackMisc
//! Description
const QString &getDescription() const { return m_description; }
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -69,7 +69,6 @@ namespace BlackMisc
//! Register metadata
void static registerMetadata();
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -139,7 +139,6 @@ namespace BlackMisc
//! Representing icon
static const CIcon &convertToIcon(const CStatusMessage &statusMessage);
protected:
//! \copydoc CValueObject::convertToQString
virtual QString convertToQString(bool i18n = false) const override;

View File

@@ -84,11 +84,11 @@ namespace BlackMisc
//! \todo Here to avoid name hiding in PQ classes. Fix during policy refactoring.
virtual void parseFromString(const QString &) { qFatal("Not implemented"); }
protected:
//! String for QString conversion
//! \todo Here because pure virtual. Move to CValueObject when all dynamic polymorphism is removed.
virtual QString convertToQString(bool i18n = false) const = 0;
protected:
//! Protected default constructor
CEmpty() = default;

View File

@@ -57,7 +57,6 @@ namespace BlackMisc
//! \copydoc CValueObject::setPropertyByIndex
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;