gui: Remove ScreenList typedef

This typedef just introduces an additional layer of indirection to
understand code.
This commit is contained in:
Povilas Kanapickas 2021-01-10 14:13:45 +02:00
parent 384dbffce4
commit a8a2b7c29a
4 changed files with 8 additions and 10 deletions

View File

@ -101,8 +101,6 @@ class Screen : public BaseConfig
bool m_Swapped;
};
typedef QList<Screen> ScreenList;
QDataStream& operator<<(QDataStream& outStream, const Screen& screen);
QDataStream& operator>>(QDataStream& inStream, Screen& screen);

View File

@ -24,7 +24,7 @@
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),
m_Screens(screens),
m_NumColumns(numColumns),

View File

@ -38,7 +38,7 @@ class ScreenSetupModel : public QAbstractTableModel
friend class ServerConfigDialog;
public:
ScreenSetupModel(ScreenList& screens, int numColumns, int numRows);
ScreenSetupModel(std::vector<Screen>& screens, int numColumns, int numRows);
public:
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]; }
private:
ScreenList& m_Screens;
std::vector<Screen>& m_Screens;
const int m_NumColumns;
const int m_NumRows;

View File

@ -44,7 +44,7 @@ class ServerConfig : public BaseConfig
~ServerConfig();
public:
const ScreenList& screens() const { return m_Screens; }
const std::vector<Screen>& screens() const { return m_Screens; }
int numColumns() const { return m_NumColumns; }
int numRows() const { return m_NumRows; }
bool hasHeartbeat() const { return m_HasHeartbeat; }
@ -73,9 +73,9 @@ class ServerConfig : public BaseConfig
protected:
QSettings& settings() { return *m_pSettings; }
ScreenList& screens() { return m_Screens; }
void setScreens(const ScreenList& screens) { m_Screens = screens; }
void addScreen(const Screen& screen) { m_Screens.append(screen); }
std::vector<Screen>& screens() { return m_Screens; }
void setScreens(const std::vector<Screen>& screens) { m_Screens = screens; }
void addScreen(const Screen& screen) { m_Screens.push_back(screen); }
void setNumColumns(int n) { m_NumColumns = n; }
void setNumRows(int n) { m_NumRows = n; }
void haveHeartbeat(bool on) { m_HasHeartbeat = on; }
@ -106,7 +106,7 @@ class ServerConfig : public BaseConfig
private:
QSettings* m_pSettings;
ScreenList m_Screens;
std::vector<Screen> m_Screens;
int m_NumColumns;
int m_NumRows;
bool m_HasHeartbeat;