diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-17 13:21:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-17 13:21:59 +0300 |
commit | df994f808e69d567fddc742656a1df86c15bf576 (patch) | |
tree | 86bc2841a3d3a4f167a3238a4e0a3c366e038550 /src | |
parent | 7c2c9f4478aa41a850b01480a8278b325f5b0f95 (diff) | |
download | mv-df994f808e69d567fddc742656a1df86c15bf576.tar.gz mv-df994f808e69d567fddc742656a1df86c15bf576.tar.bz2 mv-df994f808e69d567fddc742656a1df86c15bf576.tar.xz mv-df994f808e69d567fddc742656a1df86c15bf576.zip |
improve tablemodel.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/setup_relations.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/guitable.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/guitable.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/tablemodel.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/tablemodel.h | 14 |
5 files changed, 15 insertions, 14 deletions
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp index f63953d3d..644817331 100644 --- a/src/gui/setup_relations.cpp +++ b/src/gui/setup_relations.cpp @@ -142,7 +142,7 @@ public: return ROW_HEIGHT; } - virtual int getColumnWidth(int index) const override + virtual int getColumnWidth(const int index) const override { if (index == NAME_COLUMN) return NAME_COLUMN_WIDTH; diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 37fe17d95..460fd4218 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -199,7 +199,7 @@ int GuiTable::getRowHeight() const return 0; } -int GuiTable::getColumnWidth(int i) const +int GuiTable::getColumnWidth(const int i) const { if (mModel) return mModel->getColumnWidth(i) + 4; // border @@ -514,7 +514,7 @@ void GuiTable::mouseDragged(gcn::MouseEvent& mouseEvent) setSelectedColumn(getColumnForX(x)); } -void GuiTable::modelUpdated(bool completed) +void GuiTable::modelUpdated(const bool completed) { if (completed) { diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index b5c8883c3..2296df87b 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -151,7 +151,7 @@ public: void mouseDragged(gcn::MouseEvent& mouseEvent) override; // Constraints inherited from TableModelListener - void modelUpdated(bool) override; + void modelUpdated(const bool completed) override; void requestFocus(); @@ -163,7 +163,7 @@ protected: int getRowHeight() const A_WARN_UNUSED; - int getColumnWidth(int i) const A_WARN_UNUSED; + int getColumnWidth(const int i) const A_WARN_UNUSED; private: int getRowForY(int y) const A_WARN_UNUSED; // -1 on error diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp index 3b0c3e854..87c620afc 100644 --- a/src/gui/widgets/tablemodel.cpp +++ b/src/gui/widgets/tablemodel.cpp @@ -119,7 +119,8 @@ void StaticTableModel::set(const int row, const int column, signalAfterUpdate(); } -gcn::Widget *StaticTableModel::getElementAt(int row, int column) const +gcn::Widget *StaticTableModel::getElementAt(const int row, + const int column) const { return mTableModel[WIDGET_AT(row, column)]; } @@ -145,7 +146,7 @@ int StaticTableModel::getRowHeight() const return abs(mHeight); } -int StaticTableModel::getColumnWidth(int column) const +int StaticTableModel::getColumnWidth(const int column) const { if (column < 0 || column >= mColumns) return 0; diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index dccce65ad..427b8bf3a 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -45,7 +45,7 @@ public: * * \param completed whether we are signalling the end of the update */ - virtual void modelUpdated(bool completed) = 0; + virtual void modelUpdated(const bool completed) = 0; virtual ~TableModelListener() { } @@ -82,12 +82,12 @@ public: /** * Determines the width of each individual column */ - virtual int getColumnWidth(int index) const A_WARN_UNUSED = 0; + virtual int getColumnWidth(const int index) const A_WARN_UNUSED = 0; /** * Retrieves the widget stored at the specified location within the table. */ - virtual gcn::Widget *getElementAt(int row, int column) + virtual gcn::Widget *getElementAt(const int row, const int column) const A_WARN_UNUSED = 0; virtual void installListener(TableModelListener *const listener); @@ -147,13 +147,13 @@ public: */ virtual void resize(); - virtual int getRows() const A_WARN_UNUSED; - virtual int getColumns() const A_WARN_UNUSED; + virtual int getRows() const override A_WARN_UNUSED; + virtual int getColumns() const override A_WARN_UNUSED; virtual int getRowHeight() const override A_WARN_UNUSED; virtual int getWidth() const A_WARN_UNUSED; virtual int getHeight() const A_WARN_UNUSED; - virtual int getColumnWidth(int index) const A_WARN_UNUSED; - virtual gcn::Widget *getElementAt(int row, int column) + virtual int getColumnWidth(const int index) const override A_WARN_UNUSED; + virtual gcn::Widget *getElementAt(const int row, const int column) const override A_WARN_UNUSED; protected: |