Game created code improvements

+ No longer get "5hrs" and "5+ hrs" instead will be "4hrs" and "5+ hrs".
+ Refactored into an else-if with a single return.
+ removed comments
+ removed code from namespace and added to class
This commit is contained in:
Matt Lowe 2015-04-15 14:18:16 +02:00
parent cf313d5a8d
commit 25dbfb37f4
2 changed files with 29 additions and 56 deletions

View file

@ -18,6 +18,8 @@ private:
QMap<int, GameTypeMap> gameTypes;
static const int NUM_COLS = 8;
static const int SECS_PER_MIN = 60;
static const int SECS_PER_HOUR = 3600;
public:
static const int SORT_ROLE = Qt::UserRole+1;
@ -26,7 +28,7 @@ public:
int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return NUM_COLS; }
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
const QString getGameCreatedString(const int secs) const;
const ServerInfo_Game &getGame(int row);
/**