diff --git a/src/gui/src/Action.h b/src/gui/src/Action.h index e9f4176a..c260badc 100644 --- a/src/gui/src/Action.h +++ b/src/gui/src/Action.h @@ -87,8 +87,6 @@ class Action static const char* m_LockCursorModeNames[]; }; -typedef QList ActionList; - QTextStream& operator<<(QTextStream& outStream, const Action& action); #endif diff --git a/src/gui/src/Hotkey.cpp b/src/gui/src/Hotkey.cpp index 43a8faa2..2f018420 100644 --- a/src/gui/src/Hotkey.cpp +++ b/src/gui/src/Hotkey.cpp @@ -47,7 +47,7 @@ void Hotkey::loadSettings(QSettings& settings) settings.setArrayIndex(i); Action a; a.loadSettings(settings); - m_Actions.append(a); + m_Actions.push_back(a); } settings.endArray(); diff --git a/src/gui/src/Hotkey.h b/src/gui/src/Hotkey.h index 1a26d089..5e6fc983 100644 --- a/src/gui/src/Hotkey.h +++ b/src/gui/src/Hotkey.h @@ -27,6 +27,8 @@ #include "Action.h" #include "KeySequence.h" +#include + class HotkeyDialog; class ServerConfigDialog; class QSettings; @@ -40,10 +42,10 @@ class Hotkey const KeySequence& keySequence() const { return m_KeySequence; } void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; } - const ActionList& actions() const { return m_Actions; } - void appendAction(const Action& action) { m_Actions.append(action); } + const std::vector& actions() const { return m_Actions; } + void appendAction(const Action& action) { m_Actions.push_back(action); } void setAction(int index, const Action& action) { m_Actions[index] = action; } - void removeAction(int index) { m_Actions.removeAt(index); } + void removeAction(int index) { m_Actions.erase(m_Actions.begin() + index); } void loadSettings(QSettings& settings); void saveSettings(QSettings& settings) const; @@ -51,11 +53,9 @@ class Hotkey private: KeySequence m_KeySequence; - ActionList m_Actions; + std::vector m_Actions; }; -typedef QList HotkeyList; - QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey); #endif diff --git a/src/gui/src/Screen.h b/src/gui/src/Screen.h index cfdd4d2a..e06056f7 100644 --- a/src/gui/src/Screen.h +++ b/src/gui/src/Screen.h @@ -101,8 +101,6 @@ class Screen : public BaseConfig bool m_Swapped; }; -typedef QList ScreenList; - QDataStream& operator<<(QDataStream& outStream, const Screen& screen); QDataStream& operator>>(QDataStream& inStream, Screen& screen); diff --git a/src/gui/src/ScreenSetupModel.cpp b/src/gui/src/ScreenSetupModel.cpp index b8ff3742..8bbf2fb0 100644 --- a/src/gui/src/ScreenSetupModel.cpp +++ b/src/gui/src/ScreenSetupModel.cpp @@ -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& screens, int numColumns, int numRows) : QAbstractTableModel(NULL), m_Screens(screens), m_NumColumns(numColumns), diff --git a/src/gui/src/ScreenSetupModel.h b/src/gui/src/ScreenSetupModel.h index 89f83106..8a1a9820 100644 --- a/src/gui/src/ScreenSetupModel.h +++ b/src/gui/src/ScreenSetupModel.h @@ -38,7 +38,7 @@ class ScreenSetupModel : public QAbstractTableModel friend class ServerConfigDialog; public: - ScreenSetupModel(ScreenList& screens, int numColumns, int numRows); + ScreenSetupModel(std::vector& 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& m_Screens; const int m_NumColumns; const int m_NumRows; diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp index 6f02bc11..ed729bfb 100644 --- a/src/gui/src/ServerConfig.cpp +++ b/src/gui/src/ServerConfig.cpp @@ -183,7 +183,7 @@ void ServerConfig::loadSettings() settings().setArrayIndex(i); Hotkey h; h.loadSettings(settings()); - hotkeys().append(h); + hotkeys().push_back(h); } settings().endArray(); diff --git a/src/gui/src/ServerConfig.h b/src/gui/src/ServerConfig.h index 63e9c80f..161b00d7 100644 --- a/src/gui/src/ServerConfig.h +++ b/src/gui/src/ServerConfig.h @@ -44,7 +44,7 @@ class ServerConfig : public BaseConfig ~ServerConfig(); public: - const ScreenList& screens() const { return m_Screens; } + const std::vector& screens() const { return m_Screens; } int numColumns() const { return m_NumColumns; } int numRows() const { return m_NumRows; } bool hasHeartbeat() const { return m_HasHeartbeat; } @@ -59,7 +59,7 @@ class ServerConfig : public BaseConfig bool switchCorner(SwitchCorner c) const { return m_SwitchCorners[static_cast(c)]; } int switchCornerSize() const { return m_SwitchCornerSize; } const QList& switchCorners() const { return m_SwitchCorners; } - const HotkeyList& hotkeys() const { return m_Hotkeys; } + const std::vector& hotkeys() const { return m_Hotkeys; } bool ignoreAutoConfigClient() const { return m_IgnoreAutoConfigClient; } bool enableDragAndDrop() const { return m_EnableDragAndDrop; } bool clipboardSharing() const { return m_ClipboardSharing; } @@ -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& screens() { return m_Screens; } + void setScreens(const std::vector& 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; } @@ -93,7 +93,7 @@ class ServerConfig : public BaseConfig void setEnableDragAndDrop(bool on) { m_EnableDragAndDrop = on; } void setClipboardSharing(bool on) { m_ClipboardSharing = on; } QList& switchCorners() { return m_SwitchCorners; } - HotkeyList& hotkeys() { return m_Hotkeys; } + std::vector& hotkeys() { return m_Hotkeys; } void init(); int adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) const; @@ -106,7 +106,7 @@ class ServerConfig : public BaseConfig private: QSettings* m_pSettings; - ScreenList m_Screens; + std::vector m_Screens; int m_NumColumns; int m_NumRows; bool m_HasHeartbeat; @@ -120,7 +120,7 @@ class ServerConfig : public BaseConfig int m_SwitchDoubleTap; int m_SwitchCornerSize; QList m_SwitchCorners; - HotkeyList m_Hotkeys; + std::vector m_Hotkeys; QString m_ServerName; bool m_IgnoreAutoConfigClient; bool m_EnableDragAndDrop; diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp index 9d789d4c..57b9395b 100644 --- a/src/gui/src/ServerConfigDialog.cpp +++ b/src/gui/src/ServerConfigDialog.cpp @@ -121,7 +121,7 @@ void ServerConfigDialog::on_m_pButtonNewHotkey_clicked() HotkeyDialog dlg(this, hotkey); if (dlg.exec() == QDialog::Accepted) { - serverConfig().hotkeys().append(hotkey); + serverConfig().hotkeys().push_back(hotkey); m_pListHotkeys->addItem(hotkey.text()); } } @@ -140,7 +140,7 @@ void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked() { int idx = m_pListHotkeys->currentRow(); Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size()); - serverConfig().hotkeys().removeAt(idx); + serverConfig().hotkeys().erase(serverConfig().hotkeys().begin() + idx); m_pListActions->clear(); delete m_pListHotkeys->item(idx); }