refs #618, some functions consolidated as result of reviews in previous step (removed const/const signatures)

This commit is contained in:
Klaus Basan
2016-03-17 20:11:21 +00:00
parent 09f04c31f7
commit 301c47c594
6 changed files with 9 additions and 38 deletions

View File

@@ -155,12 +155,7 @@ namespace BlackGui
} }
} }
const CAircraftModelView *CDbAutoStashingComponent::currentModelView() const CAircraftModelView *CDbAutoStashingComponent::currentModelView() const
{
return this->getMappingComponent()->currentModelView();
}
CAircraftModelView *CDbAutoStashingComponent::currentModelView()
{ {
return this->getMappingComponent()->currentModelView(); return this->getMappingComponent()->currentModelView();
} }

View File

@@ -79,10 +79,7 @@ namespace BlackGui
int getSelectedOrAllCount() const; int getSelectedOrAllCount() const;
//! Model view to take models from //! Model view to take models from
const BlackGui::Views::CAircraftModelView *currentModelView() const; BlackGui::Views::CAircraftModelView *currentModelView() const;
//! Model view to take models from
BlackGui::Views::CAircraftModelView *currentModelView();
//! Add a status message //! Add a status message
void addStatusMessage(const BlackMisc::CStatusMessage &msg); void addStatusMessage(const BlackMisc::CStatusMessage &msg);

View File

@@ -125,12 +125,7 @@ namespace BlackGui
return this->ui->tvp_StashAircraftModels->removeModelsWithModelString(modelStrings); return this->ui->tvp_StashAircraftModels->removeModelsWithModelString(modelStrings);
} }
const Views::CAircraftModelView *CDbStashComponent::getView() const Views::CAircraftModelView *CDbStashComponent::getView() const
{
return ui->tvp_StashAircraftModels;
}
Views::CAircraftModelView *CDbStashComponent::getView()
{ {
return ui->tvp_StashAircraftModels; return ui->tvp_StashAircraftModels;
} }

View File

@@ -15,7 +15,6 @@
#include "blackgui/components/enablefordockwidgetinfoarea.h" #include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/dbmappingcomponentaware.h" #include "blackgui/components/dbmappingcomponentaware.h"
#include "blackgui/menudelegate.h" #include "blackgui/menudelegate.h"
#include "blackgui/views/aircraftmodelview.h"
#include "blackmisc/verify.h" #include "blackmisc/verify.h"
#include <QFrame> #include <QFrame>
#include <QScopedPointer> #include <QScopedPointer>
@@ -25,6 +24,7 @@ namespace Ui { class CDbStashComponent; }
namespace BlackGui namespace BlackGui
{ {
namespace Views { class CAircraftModelView; }
namespace Components namespace Components
{ {
/*! /*!
@@ -60,10 +60,7 @@ namespace BlackGui
int unstashModels(QStringList modelStrings); int unstashModels(QStringList modelStrings);
//! The embedded view //! The embedded view
const BlackGui::Views::CAircraftModelView *getView() const; BlackGui::Views::CAircraftModelView *getView() const;
//! The embedded view
Views::CAircraftModelView *getView();
//! Has stashed models //! Has stashed models
bool hasStashedModels() const; bool hasStashedModels() const;

View File

@@ -31,7 +31,7 @@ namespace BlackGui
{ {
// we already have a value // we already have a value
// changes should not happen // changes should not happen
Q_ASSERT(this->m_parentDockableInfoArea == parentDockableWidget); Q_ASSERT_X(this->m_parentDockableInfoArea == parentDockableWidget, Q_FUNC_INFO, "Reassigned parent dock widget area");
return this->m_parentDockableInfoArea == parentDockableWidget; return this->m_parentDockableInfoArea == parentDockableWidget;
} }
@@ -46,14 +46,7 @@ namespace BlackGui
return true; return true;
} }
const CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea() const CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea() const
{
Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return nullptr;
return this->m_parentDockableInfoArea->getParentInfoArea();
}
CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea()
{ {
Q_ASSERT(this->m_parentDockableInfoArea); Q_ASSERT(this->m_parentDockableInfoArea);
if (!this->m_parentDockableInfoArea) return nullptr; if (!this->m_parentDockableInfoArea) return nullptr;

View File

@@ -29,10 +29,7 @@ namespace BlackGui
{ {
public: public:
//! Corresponding dockable widget in info area //! Corresponding dockable widget in info area
BlackGui::CDockWidgetInfoArea *getDockWidgetInfoArea() { return m_parentDockableInfoArea; } BlackGui::CDockWidgetInfoArea *getDockWidgetInfoArea() const { return m_parentDockableInfoArea; }
//! Corresponding dockable widget in info area
const BlackGui::CDockWidgetInfoArea *getDockWidgetInfoArea() const { return m_parentDockableInfoArea; }
//! Has dock area? //! Has dock area?
bool hasDockWidgetArea() const { return m_parentDockableInfoArea; } bool hasDockWidgetArea() const { return m_parentDockableInfoArea; }
@@ -42,10 +39,7 @@ namespace BlackGui
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget); virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget);
//! The parent info area //! The parent info area
const CInfoArea *getParentInfoArea() const; CInfoArea *getParentInfoArea() const;
//! The parent info area
CInfoArea *getParentInfoArea();
//! Is the parent dockable widget floating? //! Is the parent dockable widget floating?
bool isParentDockWidgetFloating() const; bool isParentDockWidgetFloating() const;