version.cpp
1 //------------------------------------------------------------------------------
2 // version.cpp
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program 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
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; 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::revision()
50 {
51  return SVN_REVISION_STRING;
52 }
53 
54 unsigned long long Version::revisionNumber()
55 {
56  return SVN_REVISION_NUMBER;
57 }
58 
60 {
61  return "Doomseeker/" + versionRevision();
62 }
63 
64 QString Version::version()
65 {
66  return VERSION_STRING;
67 }
68 
70 {
71  if (revision().isEmpty())
72  {
73  return version();
74  }
75  else
76  {
77  return version() + "-" + revision();
78  }
79 }
80 
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:69
static QString userAgent()
WWW User Agent used for HTTP communications.
Definition: version.cpp:59
static QString changeset()
Definition: version.cpp:26