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 
27 {
28  return HG_REVISION_HASH_STRING;
29 }
30 
31 QString Version::name()
32 {
33  return "Doomseeker";
34 }
35 
37 {
38  #ifdef Q_OS_WIN32
39  return QString("Windows");
40  #elif defined(Q_OS_LINUX)
41  return QString("Linux");
42  #elif defined(Q_OS_MAC)
43  return QString("MAC");
44  #else
45  return QString("Unknown OS for Version::operatingSystem()");
46  #endif
47 }
48 
49 QString Version::qtPackageVersion()
50 {
51  return QString("%1-%2").arg(qVersion()).arg(1);
52 }
53 
54 QString Version::revision()
55 {
56  return HG_TIME;
57 }
58 
59 unsigned long long Version::revisionNumber()
60 {
61  return HG_REVISION_NUMBER;
62 }
63 
65 {
66  return "Doomseeker/" + versionRevision();
67 }
68 
69 QString Version::version()
70 {
71  return VERSION_STRING;
72 }
73 
75 {
76  if (revision().isEmpty())
77  {
78  return version();
79  }
80  else
81  {
82  return version() + "-" + revision();
83  }
84 }
85 
86 QString Version::yearSpan()
87 {
88  return "2009 - 2018";
89 }
static QString operatingSystem()
Name of operating system, content length and detail may vary.
Definition: version.cpp:36
static QString versionRevision()
Combines version and revision strings.
Definition: version.cpp:74
static QString userAgent()
WWW User Agent used for HTTP communications.
Definition: version.cpp:64
static QString changeset()
Definition: version.cpp:26