gui: Remove ScreenList typedef
This typedef just introduces an additional layer of indirection to understand code.
This commit is contained in:
parent
384dbffce4
commit
a8a2b7c29a
|
@ -101,8 +101,6 @@ class Screen : public BaseConfig
|
||||||
bool m_Swapped;
|
bool m_Swapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<Screen> ScreenList;
|
|
||||||
|
|
||||||
QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
|
QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
|
||||||
QDataStream& operator>>(QDataStream& inStream, Screen& screen);
|
QDataStream& operator>>(QDataStream& inStream, Screen& screen);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
const QString ScreenSetupModel::m_MimeType = "application/x-qbarrier-screen";
|
const QString ScreenSetupModel::m_MimeType = "application/x-qbarrier-screen";
|
||||||
|
|
||||||
ScreenSetupModel::ScreenSetupModel(ScreenList& screens, int numColumns, int numRows) :
|
ScreenSetupModel::ScreenSetupModel(std::vector<Screen>& screens, int numColumns, int numRows) :
|
||||||
QAbstractTableModel(NULL),
|
QAbstractTableModel(NULL),
|
||||||
m_Screens(screens),
|
m_Screens(screens),
|
||||||
m_NumColumns(numColumns),
|
m_NumColumns(numColumns),
|
||||||
|
|
|
@ -38,7 +38,7 @@ class ScreenSetupModel : public QAbstractTableModel
|
||||||
friend class ServerConfigDialog;
|
friend class ServerConfigDialog;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScreenSetupModel(ScreenList& screens, int numColumns, int numRows);
|
ScreenSetupModel(std::vector<Screen>& screens, int numColumns, int numRows);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const QString& mimeType() { return m_MimeType; }
|
static const QString& mimeType() { return m_MimeType; }
|
||||||
|
@ -60,7 +60,7 @@ class ScreenSetupModel : public QAbstractTableModel
|
||||||
Screen& screen(int column, int row) { return m_Screens[row * m_NumColumns + column]; }
|
Screen& screen(int column, int row) { return m_Screens[row * m_NumColumns + column]; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScreenList& m_Screens;
|
std::vector<Screen>& m_Screens;
|
||||||
const int m_NumColumns;
|
const int m_NumColumns;
|
||||||
const int m_NumRows;
|
const int m_NumRows;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ServerConfig : public BaseConfig
|
||||||
~ServerConfig();
|
~ServerConfig();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const ScreenList& screens() const { return m_Screens; }
|
const std::vector<Screen>& screens() const { return m_Screens; }
|
||||||
int numColumns() const { return m_NumColumns; }
|
int numColumns() const { return m_NumColumns; }
|
||||||
int numRows() const { return m_NumRows; }
|
int numRows() const { return m_NumRows; }
|
||||||
bool hasHeartbeat() const { return m_HasHeartbeat; }
|
bool hasHeartbeat() const { return m_HasHeartbeat; }
|
||||||
|
@ -73,9 +73,9 @@ class ServerConfig : public BaseConfig
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QSettings& settings() { return *m_pSettings; }
|
QSettings& settings() { return *m_pSettings; }
|
||||||
ScreenList& screens() { return m_Screens; }
|
std::vector<Screen>& screens() { return m_Screens; }
|
||||||
void setScreens(const ScreenList& screens) { m_Screens = screens; }
|
void setScreens(const std::vector<Screen>& screens) { m_Screens = screens; }
|
||||||
void addScreen(const Screen& screen) { m_Screens.append(screen); }
|
void addScreen(const Screen& screen) { m_Screens.push_back(screen); }
|
||||||
void setNumColumns(int n) { m_NumColumns = n; }
|
void setNumColumns(int n) { m_NumColumns = n; }
|
||||||
void setNumRows(int n) { m_NumRows = n; }
|
void setNumRows(int n) { m_NumRows = n; }
|
||||||
void haveHeartbeat(bool on) { m_HasHeartbeat = on; }
|
void haveHeartbeat(bool on) { m_HasHeartbeat = on; }
|
||||||
|
@ -106,7 +106,7 @@ class ServerConfig : public BaseConfig
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings* m_pSettings;
|
QSettings* m_pSettings;
|
||||||
ScreenList m_Screens;
|
std::vector<Screen> m_Screens;
|
||||||
int m_NumColumns;
|
int m_NumColumns;
|
||||||
int m_NumRows;
|
int m_NumRows;
|
||||||
bool m_HasHeartbeat;
|
bool m_HasHeartbeat;
|
||||||
|
|
Loading…
Reference in New Issue