mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 17:30:12 +08:00
Issue #77 Remove unused methods
This commit is contained in:
@@ -203,7 +203,8 @@ namespace BlackGui
|
|||||||
|
|
||||||
if (msgSettings.popupSelcalMessages())
|
if (msgSettings.popupSelcalMessages())
|
||||||
{
|
{
|
||||||
this->emitDisplayInInfoWindow(CLogMessage(this).info(u"SELCAL received"), 3 * 1000);
|
CStatusMessage msg = CLogMessage(this).info(u"SELCAL received");
|
||||||
|
this->emitDisplayInInfoWindow(CVariant::from(msg), 3 * 1000);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ namespace BlackMisc
|
|||||||
return { m_categories, m_severity, message() };
|
return { m_categories, m_severity, message() };
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogMessage::operator CVariant()
|
|
||||||
{
|
|
||||||
return CVariant::from(static_cast<CStatusMessage>(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
CLogMessage::~CLogMessage()
|
CLogMessage::~CLogMessage()
|
||||||
{
|
{
|
||||||
ostream(qtCategory()).noquote() << message();
|
ostream(qtCategory()).noquote() << message();
|
||||||
|
|||||||
@@ -49,9 +49,6 @@ namespace BlackMisc
|
|||||||
//! Convert to CStatusMessage for returning the message directly from the function which generated it.
|
//! Convert to CStatusMessage for returning the message directly from the function which generated it.
|
||||||
operator CStatusMessage();
|
operator CStatusMessage();
|
||||||
|
|
||||||
//! Convert to CVariant for returning the message directly from the function which generated it.
|
|
||||||
operator CVariant();
|
|
||||||
|
|
||||||
//! Sends a verbatim, preformatted message to the log.
|
//! Sends a verbatim, preformatted message to the log.
|
||||||
static void preformatted(const CStatusMessage &statusMessage);
|
static void preformatted(const CStatusMessage &statusMessage);
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ namespace BlackMisc
|
|||||||
//! Property by index
|
//! Property by index
|
||||||
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||||
|
|
||||||
//! Property by index as String
|
|
||||||
QString propertyByIndexAsString(const CPropertyIndex &index, bool i18n = false) const;
|
|
||||||
|
|
||||||
//! Compare for index
|
//! Compare for index
|
||||||
int comparePropertyByIndex(const CPropertyIndex &index, const Derived &compareValue) const;
|
int comparePropertyByIndex(const CPropertyIndex &index, const Derived &compareValue) const;
|
||||||
|
|
||||||
@@ -109,7 +106,6 @@ namespace BlackMisc
|
|||||||
using ::BlackMisc::Mixin::Index<DERIVED>::apply; \
|
using ::BlackMisc::Mixin::Index<DERIVED>::apply; \
|
||||||
using ::BlackMisc::Mixin::Index<DERIVED>::setPropertyByIndex; \
|
using ::BlackMisc::Mixin::Index<DERIVED>::setPropertyByIndex; \
|
||||||
using ::BlackMisc::Mixin::Index<DERIVED>::propertyByIndex; \
|
using ::BlackMisc::Mixin::Index<DERIVED>::propertyByIndex; \
|
||||||
using ::BlackMisc::Mixin::Index<DERIVED>::propertyByIndexAsString; \
|
|
||||||
using ::BlackMisc::Mixin::Index<DERIVED>::comparePropertyByIndex; \
|
using ::BlackMisc::Mixin::Index<DERIVED>::comparePropertyByIndex; \
|
||||||
using ::BlackMisc::Mixin::Index<DERIVED>::equalsPropertyByIndex;
|
using ::BlackMisc::Mixin::Index<DERIVED>::equalsPropertyByIndex;
|
||||||
// *INDENT-ON*
|
// *INDENT-ON*
|
||||||
@@ -141,12 +137,6 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Derived>
|
|
||||||
QString Index<Derived>::propertyByIndexAsString(const CPropertyIndex &index, bool i18n) const
|
|
||||||
{
|
|
||||||
return derived()->propertyByIndex(index).toQString(i18n);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Derived>
|
template <class Derived>
|
||||||
bool Index<Derived>::equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const
|
bool Index<Derived>::equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,9 +116,6 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
|
||||||
using Mixin::Index<Derived>::comparePropertyByIndex;
|
using Mixin::Index<Derived>::comparePropertyByIndex;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndexAsString
|
|
||||||
using Mixin::Index<Derived>::propertyByIndexAsString;
|
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::equalsPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::equalsPropertyByIndex
|
||||||
using Mixin::Index<Derived>::equalsPropertyByIndex;
|
using Mixin::Index<Derived>::equalsPropertyByIndex;
|
||||||
|
|
||||||
|
|||||||
@@ -477,21 +477,6 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CVariant::propertyByIndexAsString(const CPropertyIndex &index, bool i18n) const
|
|
||||||
{
|
|
||||||
auto *meta = getValueObjectMetaInfo();
|
|
||||||
Q_ASSERT(meta);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return meta->propertyByIndexAsString(data(), index, i18n);
|
|
||||||
}
|
|
||||||
catch (const Private::CVariantException &ex)
|
|
||||||
{
|
|
||||||
CLogMessage(this).debug() << ex.what();
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CVariant::equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const
|
bool CVariant::equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
auto *meta = getValueObjectMetaInfo();
|
auto *meta = getValueObjectMetaInfo();
|
||||||
|
|||||||
@@ -250,9 +250,6 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndexAsString
|
|
||||||
QString propertyByIndexAsString(const CPropertyIndex &index, bool i18n = false) const;
|
|
||||||
|
|
||||||
//! \copydoc CValueObject::equalsPropertyByIndex
|
//! \copydoc CValueObject::equalsPropertyByIndex
|
||||||
bool equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const;
|
bool equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ namespace BlackMisc
|
|||||||
virtual int compareImpl(const void *lhs, const void *rhs) const = 0;
|
virtual int compareImpl(const void *lhs, const void *rhs) const = 0;
|
||||||
virtual void setPropertyByIndex(void *object, const CVariant &variant, const CPropertyIndex &index) const = 0;
|
virtual void setPropertyByIndex(void *object, const CVariant &variant, const CPropertyIndex &index) const = 0;
|
||||||
virtual void propertyByIndex(const void *object, CVariant &o_variant, const BlackMisc::CPropertyIndex &index) const = 0;
|
virtual void propertyByIndex(const void *object, CVariant &o_variant, const BlackMisc::CPropertyIndex &index) const = 0;
|
||||||
virtual QString propertyByIndexAsString(const void *object, const CPropertyIndex &index, bool i18n) const = 0;
|
|
||||||
virtual bool equalsPropertyByIndex(const void *object, const CVariant &compareValue, const CPropertyIndex &index) const = 0;
|
virtual bool equalsPropertyByIndex(const void *object, const CVariant &compareValue, const CPropertyIndex &index) const = 0;
|
||||||
virtual bool matches(const void *object, const CVariant &value) const = 0;
|
virtual bool matches(const void *object, const CVariant &value) const = 0;
|
||||||
virtual int toIcon(const void *object) const = 0;
|
virtual int toIcon(const void *object) const = 0;
|
||||||
@@ -125,11 +124,6 @@ namespace BlackMisc
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static void propertyByIndex(CVariant &, const T &object, const CPropertyIndex &, ...) { throw CVariantException(object, "propertyByIndex"); }
|
static void propertyByIndex(CVariant &, const T &object, const CPropertyIndex &, ...) { throw CVariantException(object, "propertyByIndex"); }
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
static QString propertyByIndexAsString(const T &object, const CPropertyIndex &index, bool i18n, decltype(static_cast<void>(object.propertyByIndexAsString(index, i18n)), 0)) { return object.propertyByIndexAsString(index, i18n); }
|
|
||||||
template <typename T>
|
|
||||||
static QString propertyByIndexAsString(const T &object, const CPropertyIndex &, bool, ...) { throw CVariantException(object, "propertyByIndexAsString"); }
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static bool equalsPropertyByIndex(const T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast<void>(object.equalsPropertyByIndex(variant, index)), 0)) { return object.equalsPropertyByIndex(variant, index); }
|
static bool equalsPropertyByIndex(const T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast<void>(object.equalsPropertyByIndex(variant, index)), 0)) { return object.equalsPropertyByIndex(variant, index); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -199,10 +193,6 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
CValueObjectMetaInfoHelper::propertyByIndex(o_variant, cast(object), index, 0);
|
CValueObjectMetaInfoHelper::propertyByIndex(o_variant, cast(object), index, 0);
|
||||||
}
|
}
|
||||||
virtual QString propertyByIndexAsString(const void *object, const CPropertyIndex &index, bool i18n) const override
|
|
||||||
{
|
|
||||||
return CValueObjectMetaInfoHelper::propertyByIndexAsString(cast(object), index, i18n, 0);
|
|
||||||
}
|
|
||||||
virtual bool equalsPropertyByIndex(const void *object, const CVariant &compareValue, const CPropertyIndex &index) const override
|
virtual bool equalsPropertyByIndex(const void *object, const CVariant &compareValue, const CPropertyIndex &index) const override
|
||||||
{
|
{
|
||||||
return CValueObjectMetaInfoHelper::equalsPropertyByIndex(cast(object), compareValue, index, 0);
|
return CValueObjectMetaInfoHelper::equalsPropertyByIndex(cast(object), compareValue, index, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user