Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 73 lines (58 sloc) 1.573 kb
01069b2 @bmcdorman Changing everything
bmcdorman authored
1 #include "documentation_manager.hpp"
3700347 @bmcdorman A lot of changes..
bmcdorman authored
2
3 #include <QFile>
4 #include <QTextStream>
5
6 #define DESCRIPTION_FILE "description.txt"
7 #define DECORATION_FILE "decoration.html"
8
01069b2 @bmcdorman Changing everything
bmcdorman authored
9 using namespace Kiss;
10
3700347 @bmcdorman A lot of changes..
bmcdorman authored
11 DocumentationLocation::DocumentationLocation(const QString& name, const QString& location,
12 const QString& description, const QString& decoration)
e69323a @bmcdorman Work
bmcdorman authored
13 : m_name(name),
14 m_location(location),
15 m_description(description),
16 m_decoration(decoration)
3700347 @bmcdorman A lot of changes..
bmcdorman authored
17 {
18
19 }
20
21 const QString& DocumentationLocation::name() const
22 {
23 return m_name;
24 }
25
26 const QString& DocumentationLocation::location() const
27 {
28 return m_location;
29 }
30
31 const QString& DocumentationLocation::description() const
32 {
33 return m_description;
34 }
35
36 const QString& DocumentationLocation::decoration() const
37 {
38 return m_decoration;
39 }
40
41 DocumentationManager::DocumentationManager()
42 {
43
44 }
45
46 void DocumentationManager::addLocation(const QString& name, const QString& location)
47 {
48 m_locations.push_back(DocumentationLocation(name, location,
49 description(location), decoration(location)));
50 }
51
52 const QList<DocumentationLocation>& DocumentationManager::locations() const
53 {
54 return m_locations;
55 }
56
57 const QString DocumentationManager::description(const QString& location)
58 {
59 QFile file(location + "/" + DESCRIPTION_FILE);
60 file.open(QIODevice::ReadOnly);
61 QString ret = QTextStream(&file).readAll();
62 file.close();
63 return ret;
64 }
65
66 const QString DocumentationManager::decoration(const QString& location)
67 {
68 QFile file(location + "/" + DECORATION_FILE);
69 file.open(QIODevice::ReadOnly);
70 QString ret = QTextStream(&file).readAll();
71 file.close();
72 return ret;
73 }
Something went wrong with that request. Please try again.