Ref T529, style

This commit is contained in:
Klaus Basan
2019-02-04 17:20:53 +01:00
committed by Mat Sutcliffe
parent f363d4f41b
commit aa47d7bb03
12 changed files with 26 additions and 30 deletions

View File

@@ -171,7 +171,7 @@ namespace BlackGui
bool CColumns::isSortable(int column) const bool CColumns::isSortable(int column) const
{ {
if (!isValidColumn(column)) return false; if (!isValidColumn(column)) { return false; }
return m_columns.at(column).isSortable(); return m_columns.at(column).isSortable();
} }

View File

@@ -18,10 +18,7 @@
#include <QString> #include <QString>
class QObject;
namespace BlackMisc { namespace Simulation { class CDistributor; } } namespace BlackMisc { namespace Simulation { class CDistributor; } }
namespace BlackGui namespace BlackGui
{ {
namespace Models namespace Models
@@ -47,7 +44,7 @@ namespace BlackGui
explicit CDistributorListModel(QObject *parent = nullptr); explicit CDistributorListModel(QObject *parent = nullptr);
//! Destructor //! Destructor
virtual ~CDistributorListModel() {} virtual ~CDistributorListModel() override {}
//! Set mode //! Set mode
void setDistributorMode(DistributorMode distributorMode); void setDistributorMode(DistributorMode distributorMode);

View File

@@ -111,7 +111,7 @@ namespace BlackGui
} }
const bool changedColumn = this->setSortColumnByPropertyIndex(propertyIndex); const bool changedColumn = this->setSortColumnByPropertyIndex(propertyIndex);
const bool changedOrder = (m_sortOrder == order); const bool changedOrder = (m_sortOrder == order);
m_sortOrder = order; m_sortOrder = order;
return changedColumn || changedOrder; return changedColumn || changedOrder;
} }

View File

@@ -12,12 +12,10 @@
#ifndef BLACKGUI_MODELS_STATUSMESSAGELISTMODEL_H #ifndef BLACKGUI_MODELS_STATUSMESSAGELISTMODEL_H
#define BLACKGUI_MODELS_STATUSMESSAGELISTMODEL_H #define BLACKGUI_MODELS_STATUSMESSAGELISTMODEL_H
#include "blackgui/blackguiexport.h"
#include "blackgui/models/listmodeltimestampobjects.h" #include "blackgui/models/listmodeltimestampobjects.h"
#include "blackgui/blackguiexport.h"
#include "blackmisc/statusmessagelist.h" #include "blackmisc/statusmessagelist.h"
class QObject;
namespace BlackGui namespace BlackGui
{ {
namespace Models namespace Models

View File

@@ -35,7 +35,7 @@ namespace BlackGui
explicit CStatusMessageView(QWidget *parent = nullptr); explicit CStatusMessageView(QWidget *parent = nullptr);
//! Set mode //! Set mode
void setMode(BlackGui::Models::CStatusMessageListModel::Mode mode); void setMode(Models::CStatusMessageListModel::Mode mode);
//! Add my own filter dialog //! Add my own filter dialog
void addFilterDialog(); void addFilterDialog();

View File

@@ -538,7 +538,7 @@ namespace BlackGui
bool m_acceptDoubleClickSelection = false; //!< double clicked bool m_acceptDoubleClickSelection = false; //!< double clicked
bool m_displayAutomatically = true; //!< display directly when loaded bool m_displayAutomatically = true; //!< display directly when loaded
bool m_enableDeleteSelectedRows = false; //!< selected rows can be deleted bool m_enableDeleteSelectedRows = false; //!< selected rows can be deleted
bool m_dropIndicator = false; //!< draw indicator bool m_dropIndicator = false; //!< drop indicator
bool m_forceColumnsToMaxSize = true; //!< force that columns are extended to full viewport width bool m_forceColumnsToMaxSize = true; //!< force that columns are extended to full viewport width
bool m_allowCacheFileJson = true; //!< allow Cache format JSON to be loaded bool m_allowCacheFileJson = true; //!< allow Cache format JSON to be loaded
QWidget *m_filterWidget = nullptr; //!< filter widget or dialog QWidget *m_filterWidget = nullptr; //!< filter widget or dialog
@@ -548,7 +548,7 @@ namespace BlackGui
CLoadIndicator *m_loadIndicator = nullptr; //!< load indicator if needed CLoadIndicator *m_loadIndicator = nullptr; //!< load indicator if needed
Components::CTextEditDialog *m_textEditDialog = nullptr; //!< text edit dialog Components::CTextEditDialog *m_textEditDialog = nullptr; //!< text edit dialog
QMap<MenuFlag, Menus::CMenuActions> m_menuFlagActions; //!< initialized actions for menu flag (enum) QMap<MenuFlag, Menus::CMenuActions> m_menuFlagActions; //!< initialized actions for menu flag (enum)
QString m_saveFileName; //!< save file name (JSON) QString m_saveFileName; //!< save file name (JSON)
BlackMisc::CDirectories::ColumnIndex m_dirSettingsIndex = BlackMisc::CDirectories::IndexDirLastViewJsonOrDefault; //!< allows to set more specialized directories //!< remember last JSON directory, having this member allows to have specific dir BlackMisc::CDirectories::ColumnIndex m_dirSettingsIndex = BlackMisc::CDirectories::IndexDirLastViewJsonOrDefault; //!< allows to set more specialized directories //!< remember last JSON directory, having this member allows to have specific dir
BlackMisc::CSetting<BlackMisc::Settings::TDirectorySettings> m_dirSettings { this }; //!< directory for load/save BlackMisc::CSetting<BlackMisc::Settings::TDirectorySettings> m_dirSettings { this }; //!< directory for load/save
BlackMisc::CSettingReadOnly<Settings::TGeneralGui> m_guiSettings { this, &CViewBaseNonTemplate::settingsChanged }; //!< general GUI settings BlackMisc::CSettingReadOnly<Settings::TGeneralGui> m_guiSettings { this, &CViewBaseNonTemplate::settingsChanged }; //!< general GUI settings

View File

@@ -695,7 +695,7 @@ namespace BlackGui
int CViewBaseNonTemplate::showLoadIndicator(int containerSizeDependent, int timeoutMs, bool processEvents) int CViewBaseNonTemplate::showLoadIndicator(int containerSizeDependent, int timeoutMs, bool processEvents)
{ {
if (!m_enabledLoadIndicator) { return -1; } if (!m_enabledLoadIndicator) { return -1; }
if (m_showingLoadIndicator) { return -1; } if (m_showingLoadIndicator) { return -1; }
if (this->hasDockWidgetArea()) if (this->hasDockWidgetArea())
{ {
if (!this->isVisibleWidget()) { return -1; } if (!this->isVisibleWidget()) { return -1; }

View File

@@ -44,7 +44,7 @@ namespace BlackMisc
bool hasValidOrder() const; bool hasValidOrder() const;
//! Can given index be handled //! Can given index be handled
static bool canHandleIndex(const BlackMisc::CPropertyIndex &index); static bool canHandleIndex(const CPropertyIndex &index);
protected: protected:
//! Constructor //! Constructor
@@ -54,12 +54,12 @@ namespace BlackMisc
IOrderable(int order); IOrderable(int order);
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex //! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const; CVariant propertyByIndex(const CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex //! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant); void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
//! Compare for index //! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
int comparePropertyByIndex(const CPropertyIndex &index, const IOrderable &compareValue) const; int comparePropertyByIndex(const CPropertyIndex &index, const IOrderable &compareValue) const;
int m_order = -1; //!< order number int m_order = -1; //!< order number

View File

@@ -13,7 +13,6 @@
#define BLACKMISC_ORDERABLELIST_H #define BLACKMISC_ORDERABLELIST_H
#include "blackmisc/blackmiscexport.h" #include "blackmisc/blackmiscexport.h"
#include <QList> #include <QList>
namespace BlackMisc namespace BlackMisc

View File

@@ -225,16 +225,16 @@ namespace BlackMisc
signals: signals:
//! \copydoc IAircraftModelLoader::loadingFinished //! \copydoc IAircraftModelLoader::loadingFinished
void loadingFinished(const BlackMisc::CStatusMessageList &status, const BlackMisc::Simulation::CSimulatorInfo &simulator, BlackMisc::Simulation::IAircraftModelLoader::LoadFinishedInfo info); void loadingFinished(const BlackMisc::CStatusMessageList &status, const CSimulatorInfo &simulator, IAircraftModelLoader::LoadFinishedInfo info);
//! \copydoc IAircraftModelLoader::diskLoadingStarted //! \copydoc IAircraftModelLoader::diskLoadingStarted
void diskLoadingStarted(const BlackMisc::Simulation::CSimulatorInfo &simulator, BlackMisc::Simulation::IAircraftModelLoader::LoadMode mode); void diskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode);
//! \copydoc IAircraftModelLoader::loadingProgress //! \copydoc IAircraftModelLoader::loadingProgress
void loadingProgress(const BlackMisc::Simulation::CSimulatorInfo &simulator, const QString &message, int progressPercentage); void loadingProgress(const CSimulatorInfo &simulator, const QString &message, int progressPercentage);
//! \copydoc IAircraftModelLoader::cacheChanged //! \copydoc IAircraftModelLoader::cacheChanged
void cacheChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator); void cacheChanged(const CSimulatorInfo &simulator);
private: private:
IAircraftModelLoader *m_loaderFsx = nullptr; IAircraftModelLoader *m_loaderFsx = nullptr;

View File

@@ -12,12 +12,13 @@
#ifndef BLACKMISC_STATUSMESSAGE_H #ifndef BLACKMISC_STATUSMESSAGE_H
#define BLACKMISC_STATUSMESSAGE_H #define BLACKMISC_STATUSMESSAGE_H
#include "blackmiscexport.h"
#include "icon.h"
#include "propertyindex.h"
#include "logcategorylist.h" #include "logcategorylist.h"
#include "timestampbased.h" #include "timestampbased.h"
#include "orderable.h"
#include "icon.h"
#include "propertyindex.h"
#include "typetraits.h" #include "typetraits.h"
#include "blackmiscexport.h"
#include <QReadWriteLock> #include <QReadWriteLock>

View File

@@ -12,14 +12,15 @@
#ifndef BLACKMISC_STATUSMESSAGELIST_H #ifndef BLACKMISC_STATUSMESSAGELIST_H
#define BLACKMISC_STATUSMESSAGELIST_H #define BLACKMISC_STATUSMESSAGELIST_H
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/collection.h"
#include "blackmisc/logcategory.h"
#include "blackmisc/logcategorylist.h"
#include "blackmisc/sequence.h"
#include "blackmisc/statusmessage.h" #include "blackmisc/statusmessage.h"
#include "blackmisc/logcategorylist.h"
#include "blackmisc/logcategory.h"
#include "blackmisc/collection.h"
#include "blackmisc/sequence.h"
#include "blackmisc/timestampobjectlist.h" #include "blackmisc/timestampobjectlist.h"
#include "blackmisc/orderablelist.h"
#include "blackmisc/variant.h" #include "blackmisc/variant.h"
#include "blackmisc/blackmiscexport.h"
#include <QJsonArray> #include <QJsonArray>
#include <QMetaType> #include <QMetaType>