mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
Ref T270, split into CListModelTimestampWithOffsetObjects / CListModelTimestampObjects
This commit is contained in:
@@ -24,7 +24,7 @@ namespace BlackGui
|
|||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
CAircraftPartsListModel::CAircraftPartsListModel(QObject *parent) :
|
CAircraftPartsListModel::CAircraftPartsListModel(QObject *parent) :
|
||||||
CListModelTimestampObjects<CAircraftParts, CAircraftPartsList, true>("ViewAircraftPartsList", parent)
|
CListModelTimestampWithOffsetObjects<CAircraftParts, CAircraftPartsList, true>("ViewAircraftPartsList", parent)
|
||||||
{
|
{
|
||||||
this->addTimestampOffsetColumns();
|
this->addTimestampOffsetColumns();
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
|||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
//! Client list model
|
//! Client list model
|
||||||
class BLACKGUI_EXPORT CAircraftPartsListModel : public CListModelTimestampObjects<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>
|
class BLACKGUI_EXPORT CAircraftPartsListModel : public CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftParts, BlackMisc::Aviation::CAircraftPartsList, true>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
|||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
CAircraftSituationListModel::CAircraftSituationListModel(QObject *parent) :
|
CAircraftSituationListModel::CAircraftSituationListModel(QObject *parent) :
|
||||||
CListModelTimestampObjects<CAircraftSituation, CAircraftSituationList, true>("ViewAircraftPartsList", parent)
|
CListModelTimestampWithOffsetObjects<CAircraftSituation, CAircraftSituationList, true>("ViewAircraftPartsList", parent)
|
||||||
{
|
{
|
||||||
this->addTimestampOffsetColumns();
|
this->addTimestampOffsetColumns();
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
|||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
//! Client list model
|
//! Client list model
|
||||||
class BLACKGUI_EXPORT CAircraftSituationListModel : public CListModelTimestampObjects<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList, true>
|
class BLACKGUI_EXPORT CAircraftSituationListModel : public CListModelTimestampWithOffsetObjects<BlackMisc::Aviation::CAircraftSituation, BlackMisc::Aviation::CAircraftSituationList, true>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace BlackGui
|
|||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
CAircraftPartsView::CAircraftPartsView(QWidget *parent) :
|
CAircraftPartsView::CAircraftPartsView(QWidget *parent) :
|
||||||
CViewWithTimestampObjects(parent)
|
CViewWithTimestampWithOffsetObjects(parent)
|
||||||
{
|
{
|
||||||
this->standardInit(new CAircraftPartsListModel(this));
|
this->standardInit(new CAircraftPartsListModel(this));
|
||||||
this->setMenu(MenuDefault);
|
this->setMenu(MenuDefault);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace BlackGui
|
|||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
//! Aircraft parts
|
//! Aircraft parts
|
||||||
class BLACKGUI_EXPORT CAircraftPartsView : public CViewWithTimestampObjects<Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>
|
class BLACKGUI_EXPORT CAircraftPartsView : public CViewWithTimestampWithOffsetObjects<Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace BlackGui
|
|||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
CAircraftSituationView::CAircraftSituationView(QWidget *parent) :
|
CAircraftSituationView::CAircraftSituationView(QWidget *parent) :
|
||||||
CViewWithTimestampObjects(parent)
|
CViewWithTimestampWithOffsetObjects(parent)
|
||||||
{
|
{
|
||||||
this->standardInit(new CAircraftSituationListModel(this));
|
this->standardInit(new CAircraftSituationListModel(this));
|
||||||
this->setMenu(MenuDefault);
|
this->setMenu(MenuDefault);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace BlackGui
|
|||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
//! Aircraft situations view
|
//! Aircraft situations view
|
||||||
class BLACKGUI_EXPORT CAircraftSituationView : public CViewWithTimestampObjects<Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>
|
class BLACKGUI_EXPORT CAircraftSituationView : public CViewWithTimestampWithOffsetObjects<Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|||||||
@@ -22,20 +22,20 @@ namespace BlackGui
|
|||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
template<class ModelClass, class ContainerType, class ObjectType>
|
template<class ModelClass, class ContainerType, class ObjectType>
|
||||||
void CViewWithTimestampObjects<ModelClass, ContainerType, ObjectType>::push_frontKeepLatestAdjustedFirst(const ObjectType &object, int max)
|
void CViewWithTimestampWithOffsetObjects<ModelClass, ContainerType, ObjectType>::push_frontKeepLatestAdjustedFirst(const ObjectType &object, int max)
|
||||||
{
|
{
|
||||||
this->derivedModel()->push_frontKeepLatestAdjustedFirst(object, max);
|
this->derivedModel()->push_frontKeepLatestAdjustedFirst(object, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ModelClass, class ContainerType, class ObjectType>
|
template <class ModelClass, class ContainerType, class ObjectType>
|
||||||
CViewWithTimestampObjects<ModelClass, ContainerType, ObjectType>::CViewWithTimestampObjects(QWidget *parent) :
|
CViewWithTimestampWithOffsetObjects<ModelClass, ContainerType, ObjectType>::CViewWithTimestampWithOffsetObjects(QWidget *parent) :
|
||||||
CViewBase<ModelClass, ContainerType, ObjectType>(parent)
|
CViewBase<ModelClass, ContainerType, ObjectType>(parent)
|
||||||
{
|
{
|
||||||
// void
|
// void
|
||||||
}
|
}
|
||||||
|
|
||||||
template class CViewWithTimestampObjects<BlackGui::Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>;
|
template class CViewWithTimestampWithOffsetObjects<BlackGui::Models::CAircraftPartsListModel, BlackMisc::Aviation::CAircraftPartsList, BlackMisc::Aviation::CAircraftParts>;
|
||||||
template class CViewWithTimestampObjects<BlackGui::Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>;
|
template class CViewWithTimestampWithOffsetObjects<BlackGui::Models::CAircraftSituationListModel, BlackMisc::Aviation::CAircraftSituationList, BlackMisc::Aviation::CAircraftSituation>;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ namespace BlackGui
|
|||||||
namespace Menus { class CMenuActions; }
|
namespace Menus { class CMenuActions; }
|
||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
//! Base class for views with DB objects
|
//! Base class for views timestamp offset objects
|
||||||
template <class ModelClass, class ContainerType, class ObjectType> class CViewWithTimestampObjects :
|
template <class ModelClass, class ContainerType, class ObjectType> class CViewWithTimestampWithOffsetObjects :
|
||||||
public CViewBase<ModelClass, ContainerType, ObjectType>
|
public CViewBase<ModelClass, ContainerType, ObjectType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CViewWithTimestampObjects(QWidget *parent = nullptr);
|
explicit CViewWithTimestampWithOffsetObjects(QWidget *parent = nullptr);
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user