version.cpp
1 //------------------------------------------------------------------------------
2 // version.cpp
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2010 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #include "version.h"
24 #include "versiondefs.h"
25 
26 #include <QSysInfo>
27 
29 {
30  return HG_REVISION_HASH_STRING;
31 }
32 
33 QString Version::name()
34 {
35  return "Doomseeker";
36 }
37 
39 {
40  #ifdef Q_OS_WIN32
41  return QString("Windows");
42  #elif defined(Q_OS_LINUX)
43  return QString("Linux");
44  #elif defined(Q_OS_DARWIN)
45  return QString("MAC");
46  #else
47  return QSysInfo::prettyProductName();
48  #endif
49 }
50 
51 QString Version::qtPackageVersion()
52 {
53  return QString("%1-%2").arg(qVersion()).arg("mingw-1");
54 }
55 
56 QString Version::revision()
57 {
58  return HG_TIME;
59 }
60 
61 unsigned long long Version::revisionNumber()
62 {
63  return HG_REVISION_NUMBER;
64 }
65 
67 {
68  return "Doomseeker/" + versionRevision();
69 }
70 
71 QString Version::version()
72 {
73  return VERSION_STRING;
74 }
75 
77 {
78  if (revision().isEmpty())
79  {
80  return version();
81  }
82  else
83  {
84  return version() + "-" + revision();
85  }
86 }
87 
88 QString Version::yearSpan()
89 {
90  return "2009 - 2021";
91 }