diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2022-05-17 11:37:19 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2023-07-09 17:17:53 +0200 |
| commit | 86bb01ba9eac879d3685c439ac9da0028bc4bc80 (patch) | |
| tree | 90cc575c2d02113af459b7772418285f2e5caa1f /src/serverinfo.h | |
| parent | 7d6cb8528d20e36a4cee822263865ee2f7f32481 (diff) | |
Convert everything to CRLF.
Diffstat (limited to 'src/serverinfo.h')
| -rw-r--r-- | src/serverinfo.h | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/src/serverinfo.h b/src/serverinfo.h index af8f77c8..0bec89cc 100644 --- a/src/serverinfo.h +++ b/src/serverinfo.h @@ -1,70 +1,70 @@ -#ifndef SERVERINFO_H
-#define SERVERINFO_H
-
-#include <QString>
-#include <QDate>
-#include <QMetaType>
-
-class ServerInfo
-{
-public:
- using SpeedList = std::vector<int>;
-
- ServerInfo();
- ServerInfo(
- QString name, bool premium, QDate lastSeen, int preferred,
- SpeedList lastDownloads);
-
- const QString& name() const;
-
- bool isPremium() const;
- void setPremium(bool b);
-
- const QDate& lastSeen() const;
- void updateLastSeen();
-
- int preferred() const;
- void setPreferred(int i);
-
- const SpeedList& lastDownloads() const;
- int averageSpeed() const;
- void addDownload(int bytesPerSecond);
-
-private:
- QString m_name;
- bool m_premium;
- QDate m_lastSeen;
- int m_preferred;
- SpeedList m_lastDownloads;
-};
-
-Q_DECLARE_METATYPE(ServerInfo)
-
-
-class ServerList
-{
-public:
- using container = std::vector<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;
-
- container getPreferred() const;
-
- // removes servers that haven't been seen in a while
- //
- void cleanup();
-
-private:
- container m_servers;
-};
-
-#endif // SERVERINFO_H
+#ifndef SERVERINFO_H +#define SERVERINFO_H + +#include <QString> +#include <QDate> +#include <QMetaType> + +class ServerInfo +{ +public: + using SpeedList = std::vector<int>; + + ServerInfo(); + ServerInfo( + QString name, bool premium, QDate lastSeen, int preferred, + SpeedList lastDownloads); + + const QString& name() const; + + bool isPremium() const; + void setPremium(bool b); + + const QDate& lastSeen() const; + void updateLastSeen(); + + int preferred() const; + void setPreferred(int i); + + const SpeedList& lastDownloads() const; + int averageSpeed() const; + void addDownload(int bytesPerSecond); + +private: + QString m_name; + bool m_premium; + QDate m_lastSeen; + int m_preferred; + SpeedList m_lastDownloads; +}; + +Q_DECLARE_METATYPE(ServerInfo) + + +class ServerList +{ +public: + using container = std::vector<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; + + container getPreferred() const; + + // removes servers that haven't been seen in a while + // + void cleanup(); + +private: + container m_servers; +}; + +#endif // SERVERINFO_H |
