summaryrefslogtreecommitdiff
path: root/src/serverinfo.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-08-26 00:48:25 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-08-26 00:48:25 -0400
commit36dbb4bad74b097d44b843a2e934aa4a58ef6492 (patch)
treefc599b222b399a5f3e1b691d008970bb1db5075b /src/serverinfo.h
parent7395fbb7544740a136884e103cb0829bd10b5655 (diff)
ServerList instead of a QList of ServerInfo
changed preferred to an int moved all server settings to Settings
Diffstat (limited to 'src/serverinfo.h')
-rw-r--r--src/serverinfo.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/serverinfo.h b/src/serverinfo.h
index 79b90e77..0a8a5028 100644
--- a/src/serverinfo.h
+++ b/src/serverinfo.h
@@ -9,20 +9,49 @@ class ServerInfo
{
public:
ServerInfo();
- ServerInfo(QString name, bool premium, QDate lastSeen, bool preferred);
+ ServerInfo(
+ QString name, bool premium, QDate lastSeen, int preferred,
+ int downloadCount, double downloadSpeed);
const QString& name() const;
bool isPremium() const;
const QDate& lastSeen() const;
- bool isPreferred() const;
+ int preferred() const;
+ int downloadCount() const;
+ double downloadSpeed() const;
+
+ void setPreferred(int i);
private:
QString m_name;
bool m_premium;
QDate m_lastSeen;
- bool m_preferred;
+ int m_preferred;
+ int m_downloadCount;
+ double m_downloadSpeed;
};
Q_DECLARE_METATYPE(ServerInfo)
+
+class ServerList
+{
+public:
+ using container = QList<ServerInfo>;
+ using iterator = container::iterator;
+ using const_iterator = container::const_iterator;
+
+ void add(ServerInfo s);
+
+ iterator begin();
+ const_iterator begin() const;
+ iterator end();
+ const_iterator end() const;
+ std::size_t size() const;
+ bool empty() const;
+
+private:
+ container m_servers;
+};
+
#endif // SERVERINFO_H