aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/viewerversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/viewerversion.cpp')
-rw-r--r--linden/indra/newview/viewerversion.cpp89
1 files changed, 0 insertions, 89 deletions
diff --git a/linden/indra/newview/viewerversion.cpp b/linden/indra/newview/viewerversion.cpp
deleted file mode 100644
index 3678cb4..0000000
--- a/linden/indra/newview/viewerversion.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
1/**
2* @file viewerversion.cpp
3* @brief set the viewer version in xml
4*
5* $LicenseInfo:firstyear=2009&license=viewergpl$
6*
7* Copyright (c) 2010, McCabe Maxsted
8*
9* Imprudence Viewer Source Code
10* The source code in this file ("Source Code") is provided to you
11* under the terms of the GNU General Public License, version 2.0
12* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
13* this distribution, or online at
14* http://secondlifegrid.net/programs/open_source/licensing/gplv2
15*
16* There are special exceptions to the terms and conditions of the GPL as
17* it is applied to this Source Code. View the full text of the exception
18* in the file doc/FLOSS-exception.txt in this software distribution, or
19* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
20*
21* By copying, modifying or distributing this software, you acknowledge
22* that you have read and understood your obligations described above,
23* and agree to abide by those obligations.
24*
25* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
26* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27* COMPLETENESS OR PERFORMANCE.
28* $/LicenseInfo$
29*/
30
31#include "llviewerprecompiledheaders.h"
32
33#include "lldir.h"
34#include "llxmltree.h"
35#include "viewerversion.h"
36
37
38S32 ViewerVersion::sVersionMajor = 0;
39S32 ViewerVersion::sVersionMinor = 0;
40S32 ViewerVersion::sVersionPatch = 0;
41std::string ViewerVersion::sVersionTest = "";
42
43const std::string ViewerVersion::sViewerName = "meta-impy";
44
45ViewerVersion::ViewerVersion()
46{
47}
48
49bool ViewerVersion::initViewerVersion()
50{
51 std::string file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "viewerversion.xml");
52
53 if (!gDirUtilp->fileExists(file_path))
54 {
55 llwarns << "Unable to find viewerversion.xml in app_settings folder" << llendl;
56 return false;
57 }
58 else
59 {
60 LLXMLNodePtr root;
61
62 if (!LLXMLNode::parseFile(file_path, root, NULL))
63 {
64 llwarns << "Unable to parse version file: " << file_path << llendl;
65 return false;
66 }
67
68 if (root.isNull()) // shouldn't ever happen
69 {
70 llwarns << "Error while trying to read viewerversion.xml" << llendl;
71 return false;
72 }
73
74 LLXMLNodePtr child_nodep = root->getFirstChild();
75 while (child_nodep.notNull())
76 {
77 child_nodep->getAttributeS32("version_major", sVersionMajor);
78 child_nodep->getAttributeS32("version_minor", sVersionMinor);
79 child_nodep->getAttributeS32("version_patch", sVersionPatch);
80 child_nodep->getAttributeString("version_test", sVersionTest);
81
82 child_nodep = child_nodep->getNextSibling();
83 }
84
85 llinfos << "Version set to: " << sVersionMajor << "." << sVersionMinor << "." << sVersionPatch << " " << sVersionTest << llendl;
86
87 return true;
88 }
89}