Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : */
8 :
9 : #include "printvisitor.hpp"
10 :
11 : #include "confignode.hpp"
12 : #include "treeviewmodel.hpp"
13 :
14 0 : void PrintVisitor::visit (ConfigNode & node)
15 : {
16 0 : QStringList path = node.getPath ().split ("/");
17 0 : QString name;
18 :
19 0 : foreach (QString s, path)
20 0 : name += " ";
21 :
22 0 : name += node.getName ();
23 :
24 0 : std::cout << name.toStdString () << std::endl;
25 0 : }
26 :
27 0 : void PrintVisitor::visit (TreeViewModel * model)
28 : {
29 0 : foreach (ConfigNodePtr node, model->model ())
30 : {
31 0 : node->accept (*this);
32 : }
33 0 : }
|